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