Untitled
unknown
plain_text
2 months ago
324 B
1
Indexable
public class TwoPowers { static boolean isPower(int x){ if(x == 1){ return true; } if(x%2 != 0){ return false; } return isPower(x/2); } public static void main(String[] args) { System.out.println(isPower(2048)); } }
Editor is loading...
Leave a Comment