Python 3.7.3
n = int(input())
if n < 100 or n > 999:
print('FALSE')
exit(0)
a = n
sum = 0
while a > 0:
sum += (a % 10)
a //= 10
if sum == 13:
print('ENTER')
else:
print('LOCK')
C++
#include <iostream>
using namespace std;
int main() {
int x;
cin >> x;
if(x < 100 || x > 999) cout << "FALSE" , exit(0);
int j = x, sum = 0;
while(j) {
sum += (j % 10);
j /= 10;
}
if(sum == 13) cout << "ENTER"; else cout << "LOCK";
return 0;
Python 3.7.3
n = int(input())
if n < 100 or n > 999:
print('FALSE')
exit(0)
a = n
sum = 0
while a > 0:
sum += (a % 10)
a //= 10
if sum == 13:
print('ENTER')
else:
print('LOCK')
C++
#include <iostream>
using namespace std;
int main() {
int x;
cin >> x;
if(x < 100 || x > 999) cout << "FALSE" , exit(0);
int j = x, sum = 0;
while(j) {
sum += (j % 10);
j /= 10;
}
if(sum == 13) cout << "ENTER"; else cout << "LOCK";
return 0;
}