fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int V, A, B, C;
  6. cin >> V >> A >> B >> C; // قراءة القيم من المستخدم
  7.  
  8. if (V - A < 0) {
  9. cout << "F" << endl;
  10. return 0;
  11. }
  12. V -= A;
  13.  
  14. if (V - B < 0) {
  15. cout << "M" << endl;
  16. return 0;
  17. }
  18. V -= B;
  19.  
  20. if (V - C < 0) {
  21. cout << "T" << endl;
  22. return 0;
  23. }
  24. V -= C;
  25.  
  26. cout << "Success" << endl; // لو كل القيم ممكن تخصم
  27. return 0;
  28. }
Success #stdin #stdout 0.01s 5288KB
stdin
25 10 11 12
stdout
T