- 4
- 0
- 约3.21千字
- 约 4页
- 2023-05-30 发布于甘肃
- 举报
价格优惠的C语⾔程序,c语⾔程序设计精髓第三章编程题
1 学分绩计算(3分)
题⽬内容:
已知某⼤学期末考试学分绩的计算公式为:学分绩 =(⼯科数学 * 5 + 英语 * 1.5 + 线性代数 * 3.5) / 10
请编程从键盘按顺序输⼊某学⽣的⼯科数学、英语和线性代数成绩,计算并输出其学分绩。
以下为程序的运⾏结果⽰例:
Input math1, English and math2:80,70,100↙
Final score = 85.50
输⼊提⽰信息:Input math1, English and math2:
输⼊格式:%d,%d,%d
输出格式:Final score = %.2f\n
为避免出现格式错误,请直接拷贝粘贴题⽬中给的格式字符串和提⽰信息到你的程序中。
时间限制:500ms内存限制:32000kb
程序:
#includeint main()
{
double score;
int m1, e, m2;
printf(Input math1, English and math2:);
scanf(%d,%d,%d,m1,e,m2);
score = (m1*5 + e*1.5 + m2*3.5) / 10;
printf(Final score = %.2f\n,score);
return 0;
原创力文档

文档评论(0)