The Longest Code that I have ever written (in C++)

Although the statement has many exceptions like using my own library files for solving sorting etc.

Problems.

So avoiding all those cases let the debate on this question.

At first glance it seems easy (considering the length of the code, and difficulty).

But it turned out that after completing the coding each time I realized at the same time, a corner case.

And in the end, this resulted in 111 lines of code. (it’s actually 113, but I cut it to 111 by removing some preprocessor directives).

I’m sure we can code it better.

After all, it’s solved so I don’t want to keep my lazy ass on it.

#include

#include

#include

#include

#include

int main(int argc, char const *argv[])

int i,testc,n,nby3,nby5,pint;

scanf(“%d”, &testc);

while(testc–)

scanf(“%d”, &n);

else if (nby5==4)

else if (nby5==4)

else if (nby5==4)

else if (nby5==4)

continue;

continue;

continue;

if (pint)

if (pint)

if (pint)

if (pint)

if (pint)

if (pint)

if (pint)

if (pint)

if (pint)

if (pint)

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

printf(“\n”);

Scroll to Top