for1到100和
#include<stdio.h>
int main()
{
int a,b=0;
for(a=1;a<=100;a++)
{b=b+a;}
printf("%d",b);
return 0;
}
===================================================================
for200以内奇数
#include<stdio.h>
int main()
{
int a;
for(a=0;a<=200;a++)
{
if(a%2!=0)
{
printf("%5d",a);
}
}
return 0;
}
#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=
本文来自博客园,作者:凡是过去,皆为序曲,转载请注明原文链接:https://www.cnblogs.com/longhai3/p/15887167.html
如有疑问,欢迎提问
#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=#+=