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