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