1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| import java.util.Scanner;
public class essai {
private static Scanner reader;
public static void main(String[] args) {
reader = new Scanner(System.in);
System.out.println("Enter the String");
String s = reader.next();
char a [] = s.toCharArray();
System.out.println("Enter the character you are looking for");
System.out.println(s);
String c = reader.next();
char d = c.charAt(0);
}
public static int nombreDOccurence (char a [], char d) {
int cpt=0;
for(int i = 0; i < tab.length; ++i) {
if(a[i]==d) { cpt++;}
}
return cpt;
}
public static void nombreDOccurence (char a [], char d);
} |
Partager