A. Password Checker

A. Password Checker

Time Limit: 1.0 s

Memory Limit: 64.0 MB

Given a password, check if its valid.

A valid password satisfies the following conditions.

  • Minimum 8 character.
  • Atleast one lower case character.
  • Atleast one upper case character.
  • Atleast one digit character.
  • Atleast one special character [!@#$%^&*()].

Input format:

T, where T = number of case to check. T <= 100
S, where S = the string to check for validity. [S] <= 100

Output format:

s, where s = "valid" if the url is valid, else s = "invalid".

Sample Input:

3
1qazZAQ!
1avbac
3554535

Sample Output:

valid
invalid
invalid

Hint

C Code

#include <stdio.h>
int main(void)
{
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d\n", a + b);
    return 0;
}

C++ Code

#include <iostream>
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    cout << a + b << endl;
    return 0;
}

C# Code

using System;
using System.Linq;

class Program {
    public static void Main(string[] args) {
        Console.WriteLine(Console.ReadLine().Split().Select(int.Parse).Sum());
    }
}

Python3 Code

a, b = list(map(int, input().split()))
print(a + b)

Java Code

import java.io.*;
import java.util.Scanner;

public class Main {

    /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(a + b);
    }
}

Ruby Code

a, b = gets.split.map(&:to_i)
puts(a + b)

Source

Information

ID
1007
Difficulty
2
Category
Ad_Hoc , Implementation Click to Show
Tags
# Submissions
83
Accepted
49
Accepted Ratio
59%
Uploaded By

Related

In following contests:

Beta Round #1