fork download
  1. import java.util.Scanner;
  2.  
  3. class Main {
  4. public static void main(String[] args) {
  5. Scanner sc = new Scanner(System.in);
  6. String resp = " ";
  7. while (!resp.equals("s")) {
  8. System.out.println("Confirma?");
  9. resp = sc.nextLine();
  10. }
  11. System.out.println("confirmado");
  12. sc.close();
  13. }
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/431680/101
Success #stdin #stdout 0.14s 35612KB
stdin
n
s
stdout
Confirma?
Confirma?
confirmado