编写一简单程序,计算S=A+B+C

来源:百度知道 编辑:UC知道 时间:2024/06/24 15:59:57

用什么写啊?
这样的程序,几乎太多的东西要以实现了!!!!
以c 为例:
#include <stdio.h>
main()
{
int S,A,B,C;
printf("输入A,B,C的值:\n");
scanf("%d%d%d",&A,&B,&C);
S=A+B+C;
printf("S=%d",S);
}

C语言:
#include <stdio.h>
main()
{
int S,A,B,C;
printf("输入A,B,C的值:\n");
scanf("%d%d%d",&A,&B,&C);
S=A+B+C;
printf("S=%d",S);
}

易语言:
三个框为ABC
如果真(A.内容 = “”)
信息框(“请输入数据”)
文本框1.内容 = (A + B + C)

Visul basic:
建立一个命令按钮,其name=sum,然后写入下列程序:
Private sub sum_Click()
dim S as single
dim A as single
dim B as single
dim C as single
A=val(inputbox("请输入A值","",""))
B=val(inputbox("请输入B值","",""))
C=val(inputbox("请输入C值","",""))
S=A+B+C
Print "S=";s
end
De