Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, c;
- cin >> a >> b >> c;
- int najmal, sreden, najgolem;
- if(a <= b and a <= c) {
- najmal = a;
- if(b <= c) {
- sreden = b;
- najgolem = c;
- }
- else {
- sreden = c;
- najgolem = b;
- }
- }
- else if(b <= a and b <= c) {
- najmal = b;
- if(a <= c) {
- sreden = a;
- najgolem = c;
- }
- else {
- sreden = c;
- najgolem = a;
- }
- }
- else {
- najmal = c;
- if(a <= b) {
- sreden = a;
- najgolem = b;
- }
- else {
- sreden = b;
- najgolem = a;
- }
- }
- int rezultat = (najgolem - sreden) * 10 + (sreden - najmal) * 10;
- cout << rezultat << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement