编程输出3-8+13-18+......-68累加和的值
编程输出3-8+13-18+......-68累加和的值
收起
代码示例如下有帮助望采纳~
#include <stdio.h>
int main(int argc, char const *argv[])
{
int a = 3, flag = 1, sum = 0;
while (a < 69)
{
sum += a * flag;
a += 5;
flag *= -1;
}
printf("%d",sum);
};
报告相同问题?