【C语言】求1到100的和
#include<stdio.h> int main() { int sum = 0; int number = 1; int i = 1; while (i <= 100) { sum = sum + number; number = number + 1; i = i + 1; } printf("sum=%d",sum); return 0; }
本文来自博客园,作者:木子欢儿,转载请注明原文链接:https://www.cnblogs.com/HGNET/p/11847689.html