Compile Error
foo.c:1:12: error: initializer element is not constant 1 | password = input("Enter a password: ") | ^~~~~ foo.c:2:1: error: expected ',' or ';' before 'count' 2 | count = 0 | ^~~~~
Code
password = input("Enter a password: ")
count = 0
lenght = len(password)
if lenght >= 8:
count=count+1
for i in password:
if i >="a" and i <="z":
count = count+1
break
for i in password:
if i >="A" and i <="Z":
count = count+1
break
for i in password:
if i >="0" and i <="9":
count =count+1
break
for i in password:
if i=="!" or i=="@" or i=="#" or i=="$" or i=="%" or i=="&" or i=="^" or i=="()":
count = count+1
break
if count>=5:
print("valid")
else:
print("invalid")
Information
- Submit By
- Type
- Submission
- Problem
- P1007 Password Checker
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-02-29 13:49:59
- Judged At
- 2024-11-11 03:43:09
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes