Grosse MàJ

This commit is contained in:
olivier
2008-11-25 22:11:16 +01:00
parent 53195fdfcd
commit 3e719157ea
2980 changed files with 343846 additions and 0 deletions

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

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

View File

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

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

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

View 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.
}
}

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

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