Ajout des travaux effectuer

This commit is contained in:
2024-12-09 11:53:11 +01:00
parent 05fac8d3ae
commit c4e97e13da
558 changed files with 67900 additions and 0 deletions

Binary file not shown.

View 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]);
}
}
}

Binary file not shown.

View 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 &laquo;Bonjour !&raquo;
*
* @param args la liste des arguments de la ligne de commande (inutilisée ici)
*/
public static void main(String[] args) {
System.out.println("Bonjour !");
}
}

Binary file not shown.

View 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);
}
}

Binary file not shown.

View 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("+");
}
}

Binary file not shown.

View 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);
}
}

Binary file not shown.

View 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]);
}
}
}