Created
April 7, 2013 13:47
-
-
Save yorkie/5330561 to your computer and use it in GitHub Desktop.
计算1-100能被7整除的整数的和
This file contains hidden or 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 argc, char const *argv[]) | |
{ | |
int i = 1; | |
int sum = 0; | |
while (i <= 100) { | |
if (i % 7 == 0) sum += i; | |
i += 1; // 步增不要放在条件语句中 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment