Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. package java1.ex6;
  2. import java.util.Scanner;
  3. public class Java1Ex6 {
  4. public static void main(String[] args) {
  5. //Introduir les variables a,b et c
  6. int a, b, c;
  7. //Creer 3 Scanners
  8. Scanner one = new Scanner(System.in);
  9. Scanner two = new Scanner(System.in);
  10. Scanner three = new Scanner(System.in);
  11. //Ecrir le 1er nombre
  12. System.out.println("Ecrit le 1er nombre:");
  13. a=one.nextInt();
  14. //Ecrir le 2eme nombre
  15. System.out.println("Ecrit le 2eme nombre:");
  16. b=two.nextInt();
  17. //Ecrir le 3eme nombre
  18. System.out.println("Ecrit le 3eme nombre:");
  19. c=three.nextInt();
  20. //tester si a,b et c sont triés dans l’ordre croissant.
  21. if(a<b && b<c){
  22. System.out.println("Les 3 nombres sonts Croissants");
  23. }
  24. else if(a>b && b>c){
  25. System.out.println("Les 3 nombres sonts Decroissants");
  26. }
  27. else{
  28. System.out.println("Les 3 nombres ne sonts ni Croissants, ni Decroissants.");
  29. }
  30.  
  31. }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement