thingol
- Java != Delphi (a posição 0 da string não contém o comprimento da string)
- Java != Delphi (para fazer um loop que conte de 1 até n, você tem de fazer:
for (int i = 1; i <= n; ++i) {
}
E para fazer um loop que conte de 0 até n - 1, você tem de fazer:
for (int i = 0; i < n; ++i) {
}
erickcellani
public static void main(String[] args) {
char c = '3';
String s = "";
for(int i = 0; i < c; i++) {
s += c;
System.out.print(s + "\n");
}
}
result
3
33
333
3333
33333
333333
3333333
33333333
333333333
[telefone removido]
[telefone removido]
333333333333
3333333333333
33333333333333
333333333333333
3333333333333333
33333333333333333
333333333333333333
3333333333333333333
33333333333333333333
333333333333333333333
3333333333333333333333
33333333333333333333333
333333333333333333333333
3333333333333333333333333
33333333333333333333333333
333333333333333333333333333
3333333333333333333333333333
33333333333333333333333333333
333333333333333333333333333333
3333333333333333333333333333333
33333333333333333333333333333333
333333333333333333333333333333333
3333333333333333333333333333333333
33333333333333333333333333333333333
333333333333333333333333333333333333
3333333333333333333333333333333333333
33333333333333333333333333333333333333
333333333333333333333333333333333333333
3333333333333333333333333333333333333333
33333333333333333333333333333333333333333
333333333333333333333333333333333333333333
3333333333333333333333333333333333333333333
33333333333333333333333333333333333333333333
333333333333333333333333333333333333333333333
3333333333333333333333333333333333333333333333
33333333333333333333333333333333333333333333333
333333333333333333333333333333333333333333333333
3333333333333333333333333333333333333333333333333
33333333333333333333333333333333333333333333333333
333333333333333333333333333333333333333333333333333
:D
conectionsp
Agradeço a todos, pela ajuda…