#include<stdio.h> #include<math.h> #include<string.h> int y(int x) { if(x<1) return x; else if(x>=1&&x<10) return 2*x-1; else if(x>=10) return 3*x-11; } void main(){ int x,f; scanf("%d",&x); f=y(x); printf("%d",f); } |
Double click to view unformatted code.