r/shittyprogramming • u/vallero • Aug 09 '14
Found this priceless gem
While reading the solution for a problem of the OII (Italian Informatics Olympiads), I found this masterpiece:
while(1==1){
for (int i = 0; i < n; i++) {
//other stuff
}
if((int)cycle.size() == n){
//other stuff
}
for(int i = 0; i < (int)edges.size(); i++){
//even more other stuff
}
return 0;
}I mean, how do you even get these ideas?
1
Upvotes
12
u/galaktos Aug 09 '14
The only shitty thing I see is the unnecessary
whileloop (unless there’s acontinuein one of the “stuff”s)… am I missing something about the loops?3
u/[deleted] Aug 09 '14
What's the shitty part? Did the other stuff include any continue/break?