c语言中的对象式宏
标签:alt color turn image printf sum puts code double
1、
#include #define NUMBER 5
int main(void)
{
int i;
int sum = 0;
int a[NUMBER];
puts("please input the scores.");
for (i = 0; i )
{
printf("NO.%d: ", i + 1);
scanf("%d", &a[i]);
sum += a[i];
}
printf("sum = %5d\n", sum);
printf("mean = %5.1f\n", (double)sum / NUMBER);
return 0;
}
↓
#include #define NUMBER 10
int main(void)
{
int i;
int sum = 0;
int a[NUMBER];
puts("please input the scores.");
for (i = 0; i )
{
printf("NO.%d: ", i + 1);
scanf("%d", &a[i]);
sum += a[i];
}
printf("sum = %5d\n", sum);
printf("mean = %5.1f\n", (double)sum / NUMBER);
return 0;
}
c语言中的对象式宏
标签:alt color turn image printf sum puts code double
原文地址:https://www.cnblogs.com/liujiaxin2018/p/14254603.html
文章来自:
搜素材网的
编程语言模块,转载请注明文章出处。
文章标题:
c语言中的对象式宏
文章链接:http://soscw.com/index.php/essay/61549.html
评论