#include <stdio.h> #include <string.h> #include <stdlib.h> #include <limits.h> #include <math.h> char a[105], b; int main() { int s, t, k; while (scanf("%d", &s) != EOF) { if (s < 1) { printf("%d\n", s); } else if(s < 10) { printf("%d\n", 2 * s - 1); } else { printf("%d\n", 3 * s - 11); } } } |
Double click to view unformatted code.