+ 1

I tried to fix my code for almost one day and failed ..anyone debug it

The aim is to form a number system with only 3's and 4's in it eg. 3,4,33,34,43,44,333..... https://code.sololearn.com/cOSAhYlzi7zh/?ref=app

6th Dec 2017, 5:11 PM
Ganapathy Thiruvengadam
Ganapathy Thiruvengadam - avatar
1 Antwort
+ 2
https://code.sololearn.com/cKTibRs8PabF/#java public class Program { public static void main(String[] args) { int maxElements = 500; String[] numbers = new String[maxElements]; String num = ""; boolean isSkipped = false; // generate our fake numbers for testing for(int i = 0; i < maxElements; ++i) { numbers[i] = Integer.toString(i); } for(int i = 0; i < maxElements; ++i) { num = numbers[i]; for(int j = 0; j < num.length(); ++j) { if(num.charAt(j) != '3') { if(num.charAt(j) != '4'){ isSkipped = true; } } } if(!isSkipped){ System.out.println(num); } else { isSkipped = false; } } } } ::::OUTPUT::::: 3 4 33 34 43 44 333 334 343 344 433 434 443 444
6th Dec 2017, 6:17 PM
AgentSmith