bonjour , on me demande ce que fait ce code dans un exercice
mais déjà je ne peux le compiler
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 public class Prog1 { public static void main(String args[]) { for (int i= 1; i <= 2; i++) { for (int j= 1; j <= i; j++) { int k= i*j; if (k < 10) Terminal.ecrireChar("0"); Terminal.ecrireString(k + " "); } Terminal.sautDeLigne(); } } }
erreurs:error: class Prog1 is public, should be declared in a file named Prog1.java
et sur la ligne 6 error: incompatible types: String cannot be converted to char
merci
Partager