fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, target;
  6. string result = "false";
  7. cin >> a >> b >> target;
  8.  
  9. int R;
  10. while (b > 0) {
  11. R = a % b;
  12. a = b;
  13. b = R;
  14. }
  15. if(target%a==0){
  16. result="true";
  17. }
  18. cout << result;
  19. return 0;
  20. }
Success #stdin #stdout 0s 5500KB
stdin
3 5 4
stdout
true