Advertisement
_takumi

What

Dec 10th, 2020
928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int F(int n) {
  5.     if (n >= 5) {
  6.         return 0;
  7.     }
  8.     else if (n == 4) {
  9.         return 4;
  10.     }
  11.     else if (n == 3) {
  12.         return 6;
  13.     }
  14.     else if (n == 2) {
  15.         return 2;
  16.     }
  17.     else return 1;
  18. }
  19.  
  20. int main() {
  21. int n, k;
  22. cin >> n >> k;
  23. int ans = F(n) - F(k);
  24. if (ans < 0) {
  25.     ans = 10 - ans * (-1);
  26. }
  27. cout << ans;
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement