josiftepe

Untitled

Jan 13th, 2021
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 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.         int posledna_cifra_na_x = x % 10;
  11.         int posledna_cifra_na_y = y % 10;
  12.         cout << posledna_cifra_na_x + posledna_cifra_na_y << endl;
  13.         return 0;
  14.     }
  15. // 12345 / 10 = 1234, остаток 5
  16. // 67123 / 10 = 6712, остаток 3
  17.  
Advertisement
Add Comment
Please, Sign In to add comment