Advertisement
srvelososantos

Untitled

Apr 10th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Alabama {
  4.  
  5. public static void main(String[] args) {
  6. Scanner telado = new Scanner(System.in);
  7. int a = 1, cont = 0,c;
  8. while (true) {
  9. for (int i = 1; i <= a; i++) {
  10. if (a / i == 0) {
  11. cont++;
  12. }
  13. }
  14. if (cont == 2) {
  15. System.out.println(a + " ");
  16. }
  17. a++;
  18. cont = 0;
  19. c = telado.nextInt();
  20. if(c == 2){
  21. System.exit(1);
  22. }
  23. else{
  24. }
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement