changed the file structure
This commit is contained in:
parent
cd81159162
commit
b1c3582880
391 changed files with 675 additions and 0 deletions
BIN
Code/Steiner/findNumberXwithY/src/App.class
Normal file
BIN
Code/Steiner/findNumberXwithY/src/App.class
Normal file
Binary file not shown.
20
Code/Steiner/findNumberXwithY/src/App.java
Normal file
20
Code/Steiner/findNumberXwithY/src/App.java
Normal file
|
@ -0,0 +1,20 @@
|
|||
public class App {
|
||||
public static int findNumber(int numberOfNumbers, String startSequenz) {
|
||||
int counter = 0;
|
||||
int i = Integer.parseInt(startSequenz);
|
||||
while (true) {
|
||||
if (String.valueOf(i).startsWith(startSequenz)) {
|
||||
counter++;
|
||||
if (counter == numberOfNumbers) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(findNumber(12, "253"));
|
||||
System.out.println(findNumber(1000, "9876"));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue