Advertisement
Rehan_Rahman26

URI 2369

Jul 24th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3.      int a,b,n=0,t=0;
  4.      scanf("%d",&a);
  5.      if(a>=0 && a<=10) printf("7");
  6.     else if(a>=11 && a<=30){
  7.         n += a-10;
  8.         t += 7+n;
  9.         printf("%d",t);
  10.     }
  11.     else if(a>=31 && a<=100){
  12.         n += a-30;
  13.         t += 7+(n*2)+20;
  14.         printf("%d",t);
  15.     }
  16.     else if(a>101){
  17.         n += a-100;
  18.         t += 7+140+20+(n*5);
  19.         printf("%d",t);
  20.     }
  21.    
  22.     return 0;
  23.    
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement