Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*******************************************************************
- // NOTE: please read the 'More Info' tab to the right for shortcuts.
- //*******************************************************************
- import java.util.*;
- public class Prog {
- public static void main(String args[]){
- Scanner scanner = new Scanner(System.in);
- while(true){
- System.out.println("wprowadz wart calkowita: ");
- if(scanner.hasNextInt()){
- int value = scanner.nextInt();
- if(value <= 100 && value >= 0){
- System.out.println(value + " * 2 = " + value * 2);
- break;
- }
- System.out.println("wartosc poza zakresem");
- } else {
- System.out.println("'" + scanner.next() + "' to nie jest wart. calkowita");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement