-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Please check the solution for Q5 of Project Euler #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #include<stdio.h> | ||
| int main() | ||
| { | ||
| int n; | ||
| scanf("%d",&n); | ||
| for(int i=n;;i++) | ||
| { | ||
| int flag=1; | ||
| for(int j=1;j<=n;j++) | ||
| { | ||
| // int flag=1; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this belongs here |
||
| if(i%j!=0) | ||
| { | ||
| flag=0; | ||
| break; | ||
| } | ||
| } | ||
| if(flag==1) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a style thing but comparison to 1 is something many people don't want to see.
|
||
| { | ||
| printf("%d",i); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing linebreak at the end |
||
| break; | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a prompt for the user to know what to enter (problem states 20)