提问:编写程序。输入四个整数。求其前两个数中较小的数与后两个数中较大的数之和
要求既写出程序又给出程序运行结果
网友回答:
什么语言?以下是C++的参考
程序 :
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,s;
cin >> a >> b >> c >>d;
s=((a>b)?b:a)+ ((c>d)?c:d);
cout << s << endl;
return 0;
}
结查
提问:编写程序。输入四个整数。求其前两个数中较小的数与后两个数中较大的数之和
要求既写出程序又给出程序运行结果
网友回答:
什么语言?以下是C++的参考
程序 :
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,s;
cin >> a >> b >> c >>d;
s=((a>b)?b:a)+ ((c>d)?c:d);
cout << s << endl;
return 0;
}
结查