Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package java1.ex6;
- import java.util.Scanner;
- public class Java1Ex6 {
- public static void main(String[] args) {
- //Introduir les variables a,b et c
- int a, b, c;
- //Creer 3 Scanners
- Scanner one = new Scanner(System.in);
- Scanner two = new Scanner(System.in);
- Scanner three = new Scanner(System.in);
- //Ecrir le 1er nombre
- System.out.println("Ecrit le 1er nombre:");
- a=one.nextInt();
- //Ecrir le 2eme nombre
- System.out.println("Ecrit le 2eme nombre:");
- b=two.nextInt();
- //Ecrir le 3eme nombre
- System.out.println("Ecrit le 3eme nombre:");
- c=three.nextInt();
- //tester si a,b et c sont triés dans l’ordre croissant.
- if(a<b && b<c){
- System.out.println("Les 3 nombres sonts Croissants");
- }
- else if(a>b && b>c){
- System.out.println("Les 3 nombres sonts Decroissants");
- }
- else{
- System.out.println("Les 3 nombres ne sonts ni Croissants, ni Decroissants.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement