Skip to content

Commit 1b99a33

Browse files
github-actionsSteffenLm
authored andcommitted
Google Java Format
1 parent 21f2ced commit 1b99a33

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Exercise.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
public class Exercise {
44

55
public static void main(String[] args) {
6-
@SuppressWarnings("resource")
7-
Scanner sc = new Scanner(System.in);
6+
@SuppressWarnings("resource")
7+
Scanner sc = new Scanner(System.in);
88

9-
System.out.print("Gib bitte eine Zeichenkette ein: ");
10-
String text = sc.nextLine();
9+
System.out.print("Gib bitte eine Zeichenkette ein: ");
10+
String text = sc.nextLine();
1111

12-
System.out.print("Gib bitte das zu analysierende Zeichen ein: ");
13-
char token = sc.next().charAt(0);
12+
System.out.print("Gib bitte das zu analysierende Zeichen ein: ");
13+
char token = sc.next().charAt(0);
1414

15-
int count = 0;
16-
for (int i = 0; i < text.length(); i++) {
17-
if (text.charAt(i) == token) {
18-
count++;
19-
}
20-
}
15+
int count = 0;
16+
for (int i = 0; i < text.length(); i++) {
17+
if (text.charAt(i) == token) {
18+
count++;
19+
}
20+
}
2121

22-
double percentage = count * 100 / text.length();
22+
double percentage = count * 100 / text.length();
2323

24-
System.out.printf("Absoluter Anteil: %d%n", count);
25-
System.out.printf("Prozentualer Anteil: %.2f%%%n", percentage);
24+
System.out.printf("Absoluter Anteil: %d%n", count);
25+
System.out.printf("Prozentualer Anteil: %.2f%%%n", percentage);
2626
}
2727
}

0 commit comments

Comments
 (0)