100的累加和 for循环
1 int main() 2 { 3 int sum ; 4 int i; 5 for(i = 0; i<101; i++) 6 { 7 sum += i; 8 } 9 printf("100的累加和为:%d",sum); //5050 10 }
本文来自博客园,作者:Bytezero!,转载请注明原文链接:https://www.cnblogs.com/Bytezero/p/15070693.html
1 int main() 2 { 3 int sum ; 4 int i; 5 for(i = 0; i<101; i++) 6 { 7 sum += i; 8 } 9 printf("100的累加和为:%d",sum); //5050 10 }
本文来自博客园,作者:Bytezero!,转载请注明原文链接:https://www.cnblogs.com/Bytezero/p/15070693.html