Advertisement
ZhilinskiyG

Minitest β„–_1

Feb 6th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4. int _tmain()
  5. {
  6.     cout << "Input number on the first dise" << endl;
  7.     int a;
  8.     cin >> a;
  9.     cout << "Input number on the second dise" << endl;
  10.     int b;
  11.     cin >> b;
  12.     cout << "Input the number of the field on which you stand" << endl;
  13.     int c;
  14.     cin >> c;
  15.     cout << "Input enter the number of steps that you will pass" << endl;
  16.     if ((a + b) % 2 == 0 && c % 2 == 0){
  17.         cout << 2 * (a + b) + c;
  18.     }else{
  19.         cout << a + b + c << endl;
  20.     }
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement