Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- #include<stdint.h>
- int main()
- {
- int64_t total=2;
- int counter;
- for(int i=3;i<2000000;i+=2)
- {
- counter = 0;
- for(int j=2;j<=sqrt(i);j++)
- {
- if(i%j==0)
- {
- counter++;
- break;
- }
- }
- if(counter==0)
- {
- total=total+i;
- }
- }
- printf("%lld",total);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement