fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. int V,A,B,C;
  7. cin >> V >>A>>B>>C;
  8.  
  9. while (V>0) {
  10. if (V-A>=0) {
  11. V-=A;
  12. }
  13. else if (V-A<0)
  14. {
  15. cout << "F" << endl;
  16. }
  17. return 0 ;
  18. if (V-B >=0)
  19. V-=B;
  20. else if (V-B<0)
  21. {
  22. cout << "M" << endl;
  23. }
  24. return 0;
  25. if (V-C>=0)
  26. {
  27. V-=C;
  28. }
  29. else if ( V-C <0)
  30. {
  31. cout << "T" << endl;
  32. }
  33. return 0;
  34.  
  35. cout << "F" << endl;
  36. }
  37.  
  38.  
  39.  
  40.  
  41.  
  42. }
  43.  
Success #stdin #stdout 0s 5316KB
stdin
30 10 10 10
stdout
Standard output is empty