C++写程序输出a+b+c的和

C++写程序输出a+b+c的和


慕容森
浏览 849回答 3
3回答

隔江千里

#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 ;}&nbsp;

holdtom

#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:bdouble 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;}
打开App,查看更多内容
随时随地看视频慕课网APP