Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a;
- int b;
- int c;
- int i=0;
- int x=0;
- int y=0;
- cin >> a;
- cin >> b;
- cin >> c;
- int najmal_zbir = 1000000;
- for(int i = 1; i <= 100; i += 1) {
- int zbir = 0;
- if(a - i < 0) {
- zbir += i - a;
- }
- else {
- zbir += a - i;
- }
- if(b - i < 0) {
- zbir += i - b;
- }
- else {
- zbir += b - i;
- }
- if(c - i < 0) {
- zbir += i - c;
- }
- else {
- zbir += c - i;
- }
- if(zbir < najmal_zbir) {
- najmal_zbir = zbir;
- }
- }
- cout << najmal_zbir * 10 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment