Answers for "Sampoo C programming"

C
0

Sampoo C programming

#include<stdio.h>
 
int main(){
int v,a,b,c;
scanf("%d %d %d %d",&v,&a,&b,&c);
int temp = 0;
while(v >= 0){
    if(temp % 3 == 0){
        if(v<a){
            printf("F");
            return 0;
        }
        v -= a;
    }
    else if(temp % 3 == 1){
        if(v<b){
            printf("M");
            return 0;
        }
        v -= b;
    }
      else{
        if(v<c){
            printf("T");
            return 0;
        }
        v -= c;
    }
    temp++;
}
return 0;
}
Posted by: Guest on May-07-2022

Code answers related to "C"

Browse Popular Code Answers by Language