3 Star 2 Fork 0

lo01/introduction_to_programming

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Meanscore3.c 668 Bytes
一键复制 编辑 原始数据 按行查看 历史
JinxinDu 提交于 2022-03-31 22:09 . J.Du
#include <stdio.h>
int Meanscore3()
{
float Value,Mean,Sum;
int nb_val;
char Answer;
char temp;
Sum=0;
nb_val=0;
Answer='N'; // 'N'
while (Answer!='Y' ){
nb_val=nb_val+1;
printf("Enter the value No. %d Real between 0 and 20\n",nb_val);
// "Enter the value n:10 real between 0 and 20"
scanf("%f",&Value);
//scanf("%c",&temp);
//temp = getchar();
getchar();
Sum=Sum+Value;
printf("Do you want to stop (Y/N)?:\n");
scanf("%c",&Answer);
//printf("Answer =%c\n",Answer);
}
Mean=Sum/nb_val;
printf("the mean is %f",Mean);
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lo01/introduction_to_programming.git
git@gitee.com:lo01/introduction_to_programming.git
lo01
introduction_to_programming
introduction_to_programming
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385