Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package skola;
- import java.util.Scanner;
- /**
- *
- * @author Felix 1
- */
- public class Uppgift810 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- int start = 97;
- int antal = 20;
- int fortsätt = 1;
- Scanner inmatning = new Scanner(System.in);
- int x = start;
- do
- {
- for(int n = start; n < start + antal; n++)
- {
- System.out.println(n + "\t" + (char)n);
- x++;
- }
- System.out.println("Vill du skriva ut de nästföljande tecknena?: ");
- int svar = inmatning.nextInt();
- if(svar > 0)
- {
- System.out.println("Hur många tecken vill du skriva ut?: ");
- svar = inmatning.nextInt();
- antal = svar;
- start = x;
- }
- else
- fortsätt = -1;
- }
- while(fortsätt > 0);
- }
- }
Add Comment
Please, Sign In to add comment