Advertisement
H0_0H

Untitled

Dec 2nd, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long LL;
  4.  
  5. void fun(int x){
  6.     int y;
  7.     if (x < 0) y = x - 1;
  8.     else if (x == 0) y = 0;
  9.     else if (x < 10) y = 2 * x + 5;
  10.     else y = x + 10;
  11.     printf("%d", y);
  12. }
  13.  
  14. int main()
  15. {
  16.     int x = 7;
  17.     fun(x);
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement