Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int F(int n) {
- if (n >= 5) {
- return 0;
- }
- else if (n == 4) {
- return 4;
- }
- else if (n == 3) {
- return 6;
- }
- else if (n == 2) {
- return 2;
- }
- else return 1;
- }
- int main() {
- int n, k;
- cin >> n >> k;
- int ans = F(n) - F(k);
- if (ans < 0) {
- ans = 10 - ans * (-1);
- }
- cout << ans;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement