21 lines
559 B
Java
21 lines
559 B
Java
|
import java.util.Currency;
|
||
|
import java.io.*;
|
||
|
import java.lang.*;
|
||
|
|
||
|
public class Monnaie{
|
||
|
public static void main(String[] args) {
|
||
|
String code = new String();
|
||
|
String symbol = new String();
|
||
|
String num = new String();
|
||
|
code = args[0];
|
||
|
try{
|
||
|
Currency coder = Currency.getInstance(code);
|
||
|
num = coder.getNumericCodeAsString();
|
||
|
symbol = coder.getSymbol();
|
||
|
System.out.println("code numérique : "+ num);
|
||
|
System.out.println("symbole : "+ symbol);
|
||
|
}catch(IllegalArgumentException ie){
|
||
|
System.err.println("Valeur invalide");
|
||
|
}
|
||
|
}
|
||
|
}
|