+ 1

Why is this saying time limit exceeded?

while loop that doesnt want to cooperate? https://code.sololearn.com/cheTnkRlsobv/?ref=app

16th Jul 2017, 10:11 PM
Whitehat
Whitehat - avatar
2 Réponses
+ 7
The problem is with the ; you have written after while. remove it and you'll be fine. while(yob < 2017); { to while(yob < 2017) {
16th Jul 2017, 10:18 PM
Farshad
Farshad - avatar
+ 3
Because the code gets a certain amount of time to execute, and when that time is exceeded before the code finishes it says 'Time Limit Exceeded'. Your while loop takes too long to excecute, so it needs to be shorter.
16th Jul 2017, 10:19 PM
ChessMaster
ChessMaster - avatar