#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
main()
{
int a, s, n, count;
a = 2; s = 0; n = 1; count = 1;
while (count <= 7)
{
n = n * a;
s = s + n;
count++;
}
printf("s=%d",s);
}
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
main()
{
int a, s, n, count;
a = 2; s = 0; n = 1; count = 1;
while (count <= 7)
{
n = n * a;
s = s + n;
++count;
}
printf("s=%d",s);
}
结果是一样的