-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathP757.java
More file actions
29 lines (23 loc) · 713 Bytes
/
P757.java
File metadata and controls
29 lines (23 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package p700_799;
import java.util.Scanner;
//accepted
public class P757 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = Integer.parseInt(sc.nextLine());
for (int i = 0; i < n; i++) {
String frase = sc.nextLine();
int contadorMax = 0;
int contador = 0;
for (int j = 0; j < frase.length(); j++) {
if (frase.charAt(j) == 'T'){
contador++;
contadorMax = Math.max(contador,contadorMax);
} else {
contador=0;
}
}
System.out.println(contadorMax);
}
}
}