fork(4) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int n, conta;
  5. scanf("%i", &n);
  6.  
  7. if(n <= 10) {
  8. conta = 7;
  9. } else if (n>=11 && n<=30) {
  10. conta = (n-10) * 1 + 7;
  11. } else if (n>=31 && n<=100) {
  12. conta = (n-30) * 2 + 27;
  13. } else {
  14. conta = (n-100) * 5 + 167;
  15. }
  16.  
  17. printf("%i\n", conta);
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 10320KB
stdin
42
stdout
51