changed the file structure
This commit is contained in:
parent
cd81159162
commit
b1c3582880
391 changed files with 675 additions and 0 deletions
16
Code/Steiner/bookTaskTwo/src/App.java
Normal file
16
Code/Steiner/bookTaskTwo/src/App.java
Normal file
|
@ -0,0 +1,16 @@
|
|||
import java.util.Scanner;
|
||||
|
||||
public class App {
|
||||
public static void main(String[] args) {
|
||||
Scanner scan = new Scanner(System.in);
|
||||
System.out.println("Please enter a postive number");
|
||||
int number = scan.nextInt();
|
||||
int numberDigits = 0;
|
||||
|
||||
for (int digits = 0; number > 0; digits++) {
|
||||
number = number / 10;
|
||||
numberDigits++;
|
||||
}
|
||||
System.out.println("Your number contains: " + numberDigits + " digit(s).");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue