fork download
  1. void print_in_binary(int x) //Если не соответствует, переводит в 2-ю систему
  2. {
  3.  
  4. while (x != 1) {
  5. if (x % 2 == 0) {
  6. std::cout << "0";
  7. }
  8.  
  9. else {std::cout << "1"; }
  10. x = x / 2;
  11. }
  12. std::cout << "1" << std::endl;
  13.  
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
void print_in_binary(int x) //???? ?? ?????????????, ????????? ? 2-? ???????
^
Main.java:1: error: class, interface, or enum expected
void print_in_binary(int x) //???? ?? ?????????????, ????????? ? 2-? ???????
     ^
Main.java:7: error: class, interface, or enum expected
		}
		^
Main.java:9: error: class, interface, or enum expected
		else {std::cout << "1"; }
		                        ^
Main.java:11: error: class, interface, or enum expected
	}
	^
Main.java:14: error: class, interface, or enum expected
}
^
6 errors
stdout
Standard output is empty