Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Trabalho_1_Ex_3 {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- int a = in.nextInt();
- int b = a % 100;
- int c = (b / 10);
- int d = (b % 10);
- if (b < 10)
- System.out.println("O numero " + a
- + " tem menos de 2 algarismos.");
- else if (c == d)
- System.out.println("O numero " + a
- + " termina com uma sequencia de numeros iguais.");
- else if (c > d)
- System.out.println("O numero " + a
- + " termina com uma sequencia de numeros decrescente.");
- else if (c < d)
- System.out.println("O numero " + a
- + " termina com uma sequencia de numeros crescente.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement