Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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;
}
Source by atcoder.jp #
 
PREVIOUS NEXT
Tagged: #Sampoo #C #programming
ADD COMMENT
Topic
Name
2+9 =