Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static java.lang.System.out;
- import java.util.Scanner;
- import java.util.Collections;
- import java.util.ArrayList;
- public class ISN {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- ArrayList<Double> number = new ArrayList<Double>();
- int compteur = 0;
- double addition = 0;
- out.println("Veuillez saisir vos nombres. Tapez END pour achever votre saisie.\n" );
- out.print("=> ");
- while(!sc.hasNext("END")){
- out.print("=> ");
- number.add(sc.nextDouble());
- compteur++;
- }
- out.print("Il y a "+compteur+" nombres au total : ");
- for (double i : number){
- out.print(i + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement