Advertisement
Guest User

arrayow

a guest
Oct 1st, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import static java.lang.System.out;
  2. import java.util.Scanner;
  3. import java.util.Collections;
  4. import java.util.ArrayList;
  5.  
  6. public class ISN {
  7.  
  8.     public static void main(String[] args) {
  9.  
  10. Scanner sc = new Scanner(System.in);
  11.  
  12. ArrayList<Double> number = new ArrayList<Double>();
  13.  
  14. int compteur = 0;
  15. double addition = 0;
  16.  
  17. out.println("Veuillez saisir vos nombres. Tapez END pour achever votre saisie.\n" );
  18. out.print("=> ");
  19.  
  20. while(!sc.hasNext("END")){
  21. out.print("=> ");  
  22. number.add(sc.nextDouble());
  23. compteur++;
  24. }
  25.  
  26. out.print("Il y a "+compteur+" nombres au total : ");
  27.  
  28. for (double i : number){
  29. out.print(i + " ");
  30. }
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement