add solution for nbcontest, progra, n°5
This commit is contained in:
parent
ade2b28e74
commit
5b0f4aa468
1 changed files with 15 additions and 0 deletions
15
newbiecontest/prog/jazz/Prog12.java
Normal file
15
newbiecontest/prog/jazz/Prog12.java
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
public class Prog12 {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
int i = 0;
|
||||||
|
for (int k = 0; k <= 128 ; k++) {
|
||||||
|
i = k*k + 17;
|
||||||
|
}
|
||||||
|
System.out.println(" i : " + i);
|
||||||
|
String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
for (int k = 0;k<str.length()/3;k++) {
|
||||||
|
buffer.append(str.substring(k+2,k+3));
|
||||||
|
}
|
||||||
|
System.out.println("Resultat : " + buffer.length());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue