fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(void)
  6. {
  7. int n1, n2;
  8.  
  9. while (1)
  10. {
  11. cin >> n1 >> n2;
  12. if (n1 == 0 && n2 == 0)
  13. break;
  14. else if (n2 % n1 == 0)
  15. cout << "factor" << endl;
  16. else if (n1 % n2 == 0)
  17. cout << "multiple" << endl;
  18. else
  19. cout << "neither" << endl;
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 4676KB
stdin
8 16
32 4
17 5
0 0
stdout
factor
multiple
neither