Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Alabama {
- public static void main(String[] args) {
- Scanner telado = new Scanner(System.in);
- int a = 1, cont = 0,c;
- while (true) {
- for (int i = 1; i <= a; i++) {
- if (a / i == 0) {
- cont++;
- }
- }
- if (cont == 2) {
- System.out.println(a + " ");
- }
- a++;
- cont = 0;
- c = telado.nextInt();
- if(c == 2){
- System.exit(1);
- }
- else{
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement