编写一个C++程序,通过键盘输入三个整数,打印其和以及平均值。

[复制链接]
查看11 | 回复3 | 2017-10-9 19:50:42 | 显示全部楼层 |阅读模式
#includeint main() {int a,b,c,s;printf("请输入三个整数:");scanf("%d%d%d",&a,&b,&c);s=a+b+c;printf("%d+%d+%d=%d\nav=%f\n",a,b,c,s,s/3.0);getch();return 0;}...
回复

使用道具 举报

千问 | 2017-10-9 19:50:42 | 显示全部楼层
这么简单还问,找班上学习差不多的都会#includeint main(){ int a,b,c,sum,Average; printf("Input threedifferentinteger:"); scanf("%d",&a); scanf("%d",&b); scanf("%d",&c);...
回复

使用道具 举报

千问 | 2017-10-9 19:50:42 | 显示全部楼层
#includeusing namespace std;int main(){int num1,num2,num3;//定义三个整数cin>>num1>>num2>>num3;//输入三个整数cout>num1;//如13cout>...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行