Пример 3
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
int x;
cout << "Please input X: ";
cin >> x;
int y;
cout << "Please input Y: ";
cin >> y;
int z;
cout << "Please input Z: ";
cin >> z;
if (x == y && y == z)
{
cout << "All inputed numbers are equal" << endl;
}
else
{
if (x > y)
{
if (x > z)
{
cout << "X is the largest number" << endl;
}
else
{
cout << "Z is the largest number" << endl;
}
}
else
{
if (y > z)
{
cout << "Y is the largest number" << endl;
}
else
{
cout << "Z is the largest number" << endl;
}
}
}
system("PAUSE");
return EXIT_SUCCESS;
}
<== попередня сторінка |
| |
наступна сторінка ==> |
Пример 2 | | | Пример 4 | Переглядів: 327
Не знайшли потрібну інформацію? Скористайтесь пошуком google:
|
|