Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class PasswordGuess {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //1. прочитаме парола (текст)
- String password = scanner.nextLine();
- //2. проверка дали паролата е "s3cr3t!P@ssw0rd"
- // ако паролата е "s3cr3t!P@ssw0rd" -> Welcome
- // ако пароалта не е "s3cr3t!P@ssw0rd" -> Wrong password!
- if (password.equals("s3cr3t!P@ssw0rd")) {
- System.out.println("Welcome");
- } else {
- //различни
- System.out.println("Wrong password!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement