Fixed the repository

This commit is contained in:
Sage The DM 2024-06-24 08:18:59 +02:00
parent d3092e64bf
commit b2cded4072
318 changed files with 8017 additions and 144 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();
}
}