fork(4) download
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int a,b;
  6. while(1)
  7. {
  8. scanf("%d %d",&a,&b);
  9. if(a == 0 && b == 0) break;
  10. if(a < b){
  11. if(b%a == 0) printf("factor\n");
  12. }
  13. else if(a > b){
  14. if(a%b == 0) printf("multiple\n");
  15. }
  16. else printf("neither\n");
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 4176KB
stdin
8 16
32 4
17 5
0 0
stdout
factor
multiple