13 Fevrier
This commit is contained in:
BIN
DEV2.1/TP0:Introduction/Arguments.class
Normal file
BIN
DEV2.1/TP0:Introduction/Arguments.class
Normal file
Binary file not shown.
19
DEV2.1/TP0:Introduction/Arguments.java
Normal file
19
DEV2.1/TP0:Introduction/Arguments.java
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Cette classe est une simple coquille pour recevoir la methode principale
|
||||
*
|
||||
* @version 1.1 09 March 2014
|
||||
* @author Luc Hernandez
|
||||
*/
|
||||
public class Arguments {
|
||||
|
||||
/**
|
||||
* Affiche «Bonjour !»
|
||||
*
|
||||
* @param args la liste des arguments de la ligne de commande (inutilisee ici)
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
for(int i=0;i<args.length;i++){
|
||||
System.out.println("Bonjour "+args[i]+" !");
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/TP0:Introduction/Demarrage.class
Normal file
BIN
DEV2.1/TP0:Introduction/Demarrage.class
Normal file
Binary file not shown.
17
DEV2.1/TP0:Introduction/Demarrage.java
Normal file
17
DEV2.1/TP0:Introduction/Demarrage.java
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Cette classe est une simple coquille pour recevoir la methode principale
|
||||
*
|
||||
* @version 1.1 09 March 2014
|
||||
* @author Luc Hernandez
|
||||
*/
|
||||
public class Demarrage {
|
||||
|
||||
/**
|
||||
* Affiche «Bonjour !»
|
||||
*
|
||||
* @param args la liste des arguments de la ligne de commande (inutilisee ici)
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Bonjour !");
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/TP0:Introduction/Grille.class
Normal file
BIN
DEV2.1/TP0:Introduction/Grille.class
Normal file
Binary file not shown.
24
DEV2.1/TP0:Introduction/Grille.java
Normal file
24
DEV2.1/TP0:Introduction/Grille.java
Normal file
@@ -0,0 +1,24 @@
|
||||
public class Grille{
|
||||
public static void main(String[] args) {
|
||||
int n = Integer.parseInt(args[0]);
|
||||
for(int i=0;i<=2*n;i++){
|
||||
if(i%2==0){
|
||||
for(int j=0;j<=2*n;j++){
|
||||
if(j%2==0){
|
||||
System.out.print("+");
|
||||
} else {
|
||||
System.out.print("-");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(int j=0;j<=2*n;j++){
|
||||
if(j%2==0){
|
||||
System.out.print("|");
|
||||
} else {
|
||||
System.out.print(" ");
|
||||
}
|
||||
}
|
||||
} System.out.println("");
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/TP0:Introduction/Somme.class
Normal file
BIN
DEV2.1/TP0:Introduction/Somme.class
Normal file
Binary file not shown.
10
DEV2.1/TP0:Introduction/Somme.java
Normal file
10
DEV2.1/TP0:Introduction/Somme.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class Somme{
|
||||
|
||||
public static void main(String[] args) {
|
||||
int resultat=0;
|
||||
for(int i=0;i<args.length;i++){
|
||||
int n = Integer.parseInt(args[i]);
|
||||
resultat=resultat+n;
|
||||
} System.out.println("Le resultat est:"+" "+resultat);
|
||||
}
|
||||
}
|
||||
BIN
DEV2.1/TP0:Introduction/Tri.class
Normal file
BIN
DEV2.1/TP0:Introduction/Tri.class
Normal file
Binary file not shown.
14
DEV2.1/TP0:Introduction/Tri.java
Normal file
14
DEV2.1/TP0:Introduction/Tri.java
Normal file
@@ -0,0 +1,14 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Tri{
|
||||
|
||||
public static void main(String[] args) {
|
||||
int resultat=0;
|
||||
for(int i=0;i<args.length;i++){
|
||||
int n = Integer.parseInt(args[i]);
|
||||
} Arrays.sort(args);
|
||||
for(int i=0;i<args.length;i++){
|
||||
System.out.println(args[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user