Created
July 9, 2022 06:49
-
-
Save modos/e6d9f313335d9e7f304a715279d6f547 to your computer and use it in GitHub Desktop.
بهداشت و سلامت
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int n, x; | |
cin >> n; | |
cin >> x; | |
switch(x){ | |
case 0: | |
cout << 20; | |
break; | |
case 7: | |
cout << n; | |
break; | |
default: | |
n = n - x; | |
int res = n < 0 ? 0 : n; | |
cout << res; | |
break; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment