fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. static const char *tb[2][2]={{"1","1"},{"0","inf"}};
  7. static const char *bt[]={"1","0","inf"};
  8. double a,b;
  9. while(cin>>a>>b) cout<<tb[a==0][b==0]<<" "<<bt[((b==0)+1)*(a==0)]<<endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 4428KB
stdin
5 3
8 0
0 9
0 0
stdout
1 1
1 1
0 0
inf inf