1 solutions
-
0
C :
#include<stdio.h> int main() { int x,y; while(scanf("%d",&x)!=EOF) { if(x<1) y=x; else if(x>=1&&x<10) y=2*x-1; else y=3*x-11; printf("%d\n",y); } return 0; }C++ :
#include<stdio.h> int tab(int x) { int y; if(x<1) y=x; else if(x<=1||x<10) y=2*x-1; else y=3*x-11; return y; } int main() { int x; scanf("%d",&x); printf("%d\n",tab(x)); return 0; }
- 1
Information
- ID
- 16533
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By