changed the file structure

This commit is contained in:
Sage The DM 2024-08-27 10:41:17 +02:00
parent cd81159162
commit b1c3582880
391 changed files with 675 additions and 0 deletions

View file

@ -0,0 +1,31 @@
// împort java extansions
import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Give me a number please:");
int number = scan.nextInt();
int math = 0;
int numberOfDigits = 0;
int sum = 0;
// Number of digits
for (int tempNumber = number; tempNumber > 0; tempNumber = tempNumber / 10) {
numberOfDigits++;
}
// math the digits-diffrence
for (int tempNumber = number; tempNumber > 0; tempNumber = tempNumber / 10) {
math = tempNumber % 10;
sum += math;
}
System.out.println("Anzahl der Ziffern: " + numberOfDigits);
System.out.println("Ziffernsumme: " + sum);
scan.close();
}
}