Grosse MàJ
This commit is contained in:
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Bonjour.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Bonjour.class
Normal file
Binary file not shown.
13
workspace/G5a_exercices/fr/blankoworld/g5a/Bonjour.java
Normal file
13
workspace/G5a_exercices/fr/blankoworld/g5a/Bonjour.java
Normal file
@ -0,0 +1,13 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
class Bonjour {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
System.out.println("Bonjour Dave ...");
|
||||
}
|
||||
|
||||
}
|
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/BonjourToi.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/BonjourToi.class
Normal file
Binary file not shown.
30
workspace/G5a_exercices/fr/blankoworld/g5a/BonjourToi.java
Normal file
30
workspace/G5a_exercices/fr/blankoworld/g5a/BonjourToi.java
Normal file
@ -0,0 +1,30 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
import java.util.*;
|
||||
import java.text.*;
|
||||
|
||||
import iutsud.Console;
|
||||
|
||||
public class BonjourToi {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
String x;
|
||||
int y;
|
||||
int annee;
|
||||
|
||||
System.out.println("Saisissez votre pr<70>nom : ");
|
||||
x=Console.readLine();
|
||||
System.out.println("Saisissez votre date de naissance : ");
|
||||
y=Console.readInt();
|
||||
|
||||
DateFormat format = new SimpleDateFormat("yyyy");
|
||||
annee = Integer.parseInt(format.format(new Date()));
|
||||
|
||||
System.out.println("Bonjour " + x + ", vous avez " + (annee - y) + " ans.");
|
||||
}
|
||||
|
||||
}
|
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/ConvertEntier.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/ConvertEntier.class
Normal file
Binary file not shown.
@ -0,0 +1,17 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
public class ConvertEntier {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
int parametre = Integer.parseInt(args[0]);
|
||||
|
||||
System.out.println("en binaire: " + parametre + " => " + Integer.toBinaryString(parametre));
|
||||
System.out.println("en octale : " + parametre + " => " + Integer.toOctalString(parametre));
|
||||
System.out.println("en hexad<61>cimale : " + parametre + " => " + Integer.toHexString(parametre));
|
||||
}
|
||||
|
||||
}
|
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Dichotomique.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Dichotomique.class
Normal file
Binary file not shown.
32
workspace/G5a_exercices/fr/blankoworld/g5a/Dichotomique.java
Normal file
32
workspace/G5a_exercices/fr/blankoworld/g5a/Dichotomique.java
Normal file
@ -0,0 +1,32 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
public class Dichotomique {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
int longueur = args.length;
|
||||
int i = 1;
|
||||
int indice = 0;
|
||||
|
||||
while(i != longueur) {
|
||||
if(Integer.parseInt(args[0])==Integer.parseInt(args[i]))
|
||||
{
|
||||
indice = i;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
||||
if(indice == 0)
|
||||
{
|
||||
System.out.print("L'entier " + args[0] + " ne se trouve pas dans le tableau.");
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.print("L'entier " + args[0] + " se trouve <20> l'indice " + indice + " du tableau.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/InverseArgs.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/InverseArgs.class
Normal file
Binary file not shown.
27
workspace/G5a_exercices/fr/blankoworld/g5a/InverseArgs.java
Normal file
27
workspace/G5a_exercices/fr/blankoworld/g5a/InverseArgs.java
Normal file
@ -0,0 +1,27 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
public class InverseArgs {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
int longueur;
|
||||
longueur = args.length - 1;
|
||||
|
||||
for ( int i=longueur; i >= 0 ; i-- )
|
||||
{
|
||||
System.out.print(args[i]);
|
||||
if (i == 0)
|
||||
{
|
||||
System.out.println(".");
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.print(" ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Premier.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Premier.class
Normal file
Binary file not shown.
14
workspace/G5a_exercices/fr/blankoworld/g5a/Premier.java
Normal file
14
workspace/G5a_exercices/fr/blankoworld/g5a/Premier.java
Normal file
@ -0,0 +1,14 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
public class Premier {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
// Le petit th<74>or<6F>me de Fermat signale que si P est premier alors pour tout nombre A, (A^(P-1)-1) est divisible par P.
|
||||
|
||||
}
|
||||
|
||||
}
|
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Puissance.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/Puissance.class
Normal file
Binary file not shown.
40
workspace/G5a_exercices/fr/blankoworld/g5a/Puissance.java
Normal file
40
workspace/G5a_exercices/fr/blankoworld/g5a/Puissance.java
Normal file
@ -0,0 +1,40 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
import iutsud.Console;
|
||||
|
||||
public class Puissance {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
int x;
|
||||
int y;
|
||||
int resultat;
|
||||
|
||||
x = Integer.parseInt(args[0]);
|
||||
y = Integer.parseInt(args[1]);
|
||||
|
||||
if(y==0)
|
||||
{
|
||||
resultat = 1;
|
||||
}
|
||||
else if (y==1)
|
||||
{
|
||||
resultat = x;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i = 0;
|
||||
resultat = x;
|
||||
for(i = 1; i < y; i++)
|
||||
{
|
||||
resultat = resultat * y;
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(resultat);
|
||||
}
|
||||
|
||||
}
|
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/SommeEntiers.class
Normal file
BIN
workspace/G5a_exercices/fr/blankoworld/g5a/SommeEntiers.class
Normal file
Binary file not shown.
29
workspace/G5a_exercices/fr/blankoworld/g5a/SommeEntiers.java
Normal file
29
workspace/G5a_exercices/fr/blankoworld/g5a/SommeEntiers.java
Normal file
@ -0,0 +1,29 @@
|
||||
package fr.blankoworld.g5a;
|
||||
|
||||
public class SommeEntiers {
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// TODO Auto-generated method stub
|
||||
int longueur = args.length;
|
||||
int resultat;
|
||||
|
||||
if (longueur == 0) {
|
||||
System.out.println("Aucun param<61>tre n'a <20>t<EFBFBD> entr<74>.");
|
||||
}
|
||||
else if(longueur == 1) {
|
||||
System.out.println("Vous n'avez pass<73> qu'un argument : " + args[0]);
|
||||
}
|
||||
else {
|
||||
resultat = 0;
|
||||
for (int i = 0; i < args.length; i++){
|
||||
resultat += Integer.parseInt(args[i]);
|
||||
}
|
||||
|
||||
System.out.println(resultat);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user