Advertisement
kadeyrov

Untitled

Aug 23rd, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <string>
  6. #include <set>
  7.  
  8. using namespace std;
  9.  
  10. int main () {
  11.     int k, r;
  12.    
  13.     cin >> k >> r;
  14.    
  15.     for (int i = 1; i < 11; i++) {
  16.         if ((((k * i) % 10) == r) || (((k * i) % 10) == 0)) {
  17.             cout << i << endl;
  18.             return 0;
  19.         }
  20.     }
  21.    
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement