亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

C++寫程序輸出a+b+c的和

C++寫程序輸出a+b+c的和

C++
浮云間 2019-04-15 08:08:02
C++寫程序輸出a+b+c的和
查看完整描述

3 回答

?
不負相思意

TA貢獻1777條經驗 獲得超10個贊



#include<iostream>
int main()
{
std::cout<<"Enter three nembers:"<<std::endl;
int a,b,c;
std::cin >>a>>b>>c;
std::cout << "The sum of " << a<< " and " <<b<<"and"<<c
<< " is " <<a + b + c<< std::endl;
system("PAUSE");
return 0 ;
}



 





查看完整回答
反對 回復 2019-04-28
?
神不在的星期二

TA貢獻1963條經驗 獲得超6個贊


#include "stdafx.h"
#include <iostream>

void Max2(double a,double b)
{
int max=a>b?a:b,
cout<<"Double a "<<"and"<<" double b's Max is:"<<max<<endl;
return ;
}

void Max2(int a int b)
{
int max=a>b?a:b;
cout<<"Int a "<<"and"<<" int b's Max is:"<<max<<endl;
return ;
}
void Max3(double a,double b,double c)
{
double temp=a>b?a:b;
double max1 = temp1>c?temp:c;
cout<<"Double a "<<", double b "<<"and"<<" double c's Max is:"<<max<<endl;
return;
}

void Max3(int a,int b,int c)
{
double temp=a>b?a:b
double max= temp>c?temp:c;
cout<<"Int a "<<", int b "<<"and"<<" int c's Max is:"<<max<<endl;
}

int main(int argc, char* argv[])
{
double a,b,c;
// int a,b,c;
cin>>a;
cin>>b;
cin>>c;
Max2(a,b);
Max3(a,b,c);
return 0;
}





查看完整回答
反對 回復 2019-04-28
  • 3 回答
  • 0 關注
  • 492 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號