#include"stdio.h"
void main()
{
int i=1,sum=0;
while(i<=10)
{
sum+=i;
i+=2;
}
printf("sum=%d",sum);
}
其实用for回更快啊
void main()
{
int i=1,sum=0;
while(i<=10)
{
sum+=i;
i+=2;
}
printf("sum=%d",sum);
}
其实用for回更快啊
[此贴子已经被作者于2007-8-15 15:54:59编辑过]