Created
September 28, 2014 01:08
-
-
Save jingning42/6cb043a578bec4deb07a to your computer and use it in GitHub Desktop.
Project_Euler#1.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
int sum = 0, num; | |
for (num = 0; num < 1000; num ++){ | |
if (num % 3 == 0 || num % 5 == 0){ | |
sum = sum + num; | |
} | |
} | |
printf("sum = %d",sum); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment