Advertisement
Raul_julian

Conta-[OBI]

Jun 17th, 2013
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int f1=7, f2=20, f3=140, N;
  6.  
  7.     scanf("%d", &N);
  8.    
  9.     if(N<0 || N>120) return 0;
  10.     if(N<=10) printf("%d", f1);
  11.     if(N>10 && N<31) printf("%d", f1+((N-10)*1));
  12.     if(N>31 && N<101) printf("%d", f1+f2+((N-30)*2));
  13.     if(N>100 && N<121) printf("%d", f1+f2+f3+((N-100)*5));
  14.    
  15.  
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement