Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class DoTrzechRazySztuka {
- public static void czytaj(){
- Scanner keyboard = new Scanner(System.in);
- int wrong_inputs = 0;
- while (wrong_inputs != 3) {
- System.out.println("> ");
- try {
- float in_data = keyboard.nextFloat();
- System.out.println("x = " + in_data);
- break;
- } catch (Exception e) {
- System.out.println("Nie poprawne dane wyjściowe.(Oczekiwana wartość zmienno przecinkowa)");
- wrong_inputs++;
- keyboard.next();
- continue;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement