fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int k;
  6. double n;
  7. cin >> k;
  8. for (int i = 0; i < k; i++) {
  9. cin >> n;
  10. bool p = true;
  11. while (n > 1) {
  12. n /= (p ? 9 : 2);
  13. p = !p;
  14. }
  15. cout << p + 1 << "\n";
  16. }
  17. return 0;
  18. }
Success #stdin #stdout 0s 4416KB
stdin
Standard input is empty
stdout
Standard output is empty