Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI / Pract. 02 / Solutions / task3 - no EPSILON.cpp
blob: 6c9f83266da76e6583369838a3d4054f0dd0947b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	 double x, y;

	 cout << "Enter the first number: ";
	 cin >> x;

	 cout << "Enter the second number: ";
	 cin >> y;

	 if (fabs(x - y) < 0.000001)
	 {
		  cout << "Numbers must be different!\n";
		  return 1;
	 }

	 cout << (x < y ? y : x) << " is the greater number!\n";

	 return 0;
}