热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_44511851
M1sak1Me1
4 年前
trueweixin_44511851

Juc问题:想问问各位大佬如果多核cpu并行的对同一个共享变量执行了cas操作会发生什么

你问我答
CSDN App 扫码分享
分享
1
点赞
打赏
  • 复制链接
  • 举报
下一条:
已知某大学期末考试学分绩的计算公式为:学分绩 =(工科数学 * 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"#include <stdio.h>#include<stdlib.h>int main(){ int math1,English,math2 ; printf ("Input math1, English and math2:"); scanf ("%d,%d,%d",&math1,&English,&math2); printf("Final score = %.2f\n",(math1*5 + English*1.5 + math2 *3.5)/10); return 0;}
立即登录