3 回答
TA贡献1906条经验 获得超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 ;
}
TA贡献1805条经验 获得超10个赞
#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;
}
- 3 回答
- 0 关注
- 848 浏览
添加回答
举报