josiftepe

Untitled

Jan 20th, 2021
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int x;
  7.     int y;
  8.     cin >> x;
  9.     cin >> y;
  10.    
  11.     int sredna_cifra_na_x = (x / 10) % 10;
  12.     int sredna_cifra_na_y = (y / 10) % 10;
  13.     cout << sredna_cifra_na_x + sredna_cifra_na_y << endl;
  14.     // 321 / 10 = 32
  15.     // 32 % 10 = 2
  16.    
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment