Ajout des travaux effectuer
This commit is contained in:
BIN
23DEV1.1/TPS2/TP01/Introduction/Arguments.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Introduction/Arguments.class
Normal file
Binary file not shown.
9
23DEV1.1/TPS2/TP01/Introduction/Arguments.java
Normal file
9
23DEV1.1/TPS2/TP01/Introduction/Arguments.java
Normal file
@@ -0,0 +1,9 @@
|
||||
public class Arguments {
|
||||
|
||||
public static void main(String[] args) {
|
||||
for(int i = 0; i <args.length ; i++)
|
||||
{
|
||||
System.out.println("Bonjour " +args[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Introduction/Bonjour.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Introduction/Bonjour.class
Normal file
Binary file not shown.
17
23DEV1.1/TPS2/TP01/Introduction/Bonjour.java
Normal file
17
23DEV1.1/TPS2/TP01/Introduction/Bonjour.java
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Cette classe est une simple coquille pour recevoir la méthode principale
|
||||
*
|
||||
* @version 1.1 09 March 2014
|
||||
* @author Luc Hernandez
|
||||
*/
|
||||
public class Bonjour {
|
||||
|
||||
/**
|
||||
* Affiche «Bonjour !»
|
||||
*
|
||||
* @param args la liste des arguments de la ligne de commande (inutilisée ici)
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Bonjour !");
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Introduction/Demarrage.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Introduction/Demarrage.class
Normal file
Binary file not shown.
20
23DEV1.1/TPS2/TP01/Introduction/Demarrage.java
Normal file
20
23DEV1.1/TPS2/TP01/Introduction/Demarrage.java
Normal file
@@ -0,0 +1,20 @@
|
||||
public class Demarrage {
|
||||
public static void main(String[] args) {
|
||||
byte a = 42;
|
||||
short b = 5;
|
||||
int c = 7;
|
||||
long d = 78;
|
||||
boolean e = true;
|
||||
char f = 'y';
|
||||
float g = -1.5f;
|
||||
double h = 47.0d;
|
||||
System.out.println(a);
|
||||
System.out.println(b);
|
||||
System.out.println(c);
|
||||
System.out.println(d);
|
||||
System.out.println(e);
|
||||
System.out.println(f);
|
||||
System.out.println(g);
|
||||
System.out.println(h);
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Introduction/Grille.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Introduction/Grille.class
Normal file
Binary file not shown.
23
23DEV1.1/TPS2/TP01/Introduction/Grille.java
Normal file
23
23DEV1.1/TPS2/TP01/Introduction/Grille.java
Normal file
@@ -0,0 +1,23 @@
|
||||
public class Grille {
|
||||
public static void main(String[] args) {
|
||||
int n = Integer.parseInt(args[0]);
|
||||
for(int i = 0 ; i<n ; i++){
|
||||
for(int j = 0 ; j<n ; j++){
|
||||
if(i%2==0){
|
||||
System.out.print("+-");
|
||||
}else{
|
||||
System.out.print("| ");
|
||||
}
|
||||
}
|
||||
if(i%2==0){
|
||||
System.out.println("+");
|
||||
}else{
|
||||
System.out.println("|");
|
||||
}
|
||||
}
|
||||
for(int j = 0 ; j<n ; j++){
|
||||
System.out.print("+-");
|
||||
}
|
||||
System.out.println("+");
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Introduction/Sommes.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Introduction/Sommes.class
Normal file
Binary file not shown.
11
23DEV1.1/TPS2/TP01/Introduction/Sommes.java
Normal file
11
23DEV1.1/TPS2/TP01/Introduction/Sommes.java
Normal file
@@ -0,0 +1,11 @@
|
||||
public class Sommes {
|
||||
|
||||
public static void main(String[] args) {
|
||||
int n, result = 0;
|
||||
for(int i = 0 ; i < args.length ; i++){
|
||||
n = Integer.parseInt(args[i]);
|
||||
result = n + result;
|
||||
}
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Introduction/Tri.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Introduction/Tri.class
Normal file
Binary file not shown.
16
23DEV1.1/TPS2/TP01/Introduction/Tri.java
Normal file
16
23DEV1.1/TPS2/TP01/Introduction/Tri.java
Normal file
@@ -0,0 +1,16 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Tri {
|
||||
public static void main(String[] args) {
|
||||
int n = args.length;
|
||||
int[] tab = null;
|
||||
tab = new int[n];
|
||||
for(int i = 0 ; i < n ; i++){
|
||||
tab[i] = Integer.parseInt(args[i]);
|
||||
}
|
||||
Arrays.sort(tab);
|
||||
for(int i = 0 ; i < tab.length ; i++){
|
||||
System.out.println(tab[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user