fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a , b , c;
  8.  
  9. cin >> a>>b>>c;
  10.  
  11. if (c % a == 0 && c % b == 0)
  12. {
  13. cout <<"Both";
  14. }
  15. else if ( c % a == 0 && c % b != 0 )
  16. cout <<"First";
  17.  
  18. else if ( c % a != 0 && c % b == 0 )
  19. cout <<"Second";
  20.  
  21. else
  22. cout <<"None of them";
  23.  
  24.  
  25.  
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 4308KB
stdin
Standard input is empty
stdout
None  of them