请问我这代码哪里错了?
#include <stdio.h>
int main()
{
int sum=0;
int i=1;
int flag=1;
while(i<=100)
{
i++;
sum=i*flag+sum;
flag=flag*-1;
printf("sum=%d\n","sum");
}
#include <stdio.h>
int main()
{
int sum=0;
int i=1;
int flag=1;
while(i<=100)
{
i++;
sum=i*flag+sum;
flag=flag*-1;
printf("sum=%d\n","sum");
}
2020-02-11
举报