Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int a,b,n=0,t=0;
- scanf("%d",&a);
- if(a>=0 && a<=10) printf("7");
- else if(a>=11 && a<=30){
- n += a-10;
- t += 7+n;
- printf("%d",t);
- }
- else if(a>=31 && a<=100){
- n += a-30;
- t += 7+(n*2)+20;
- printf("%d",t);
- }
- else if(a>101){
- n += a-100;
- t += 7+140+20+(n*5);
- printf("%d",t);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement