aboutsummaryrefslogtreecommitdiffstats
path: root/overcomplicated_loop.c
blob: a843a8a94e1d63a27a067d5bd4b5afe55828a5d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

static jmp_buf env;

int main (void)
{
    srand(time(NULL));
    int a = 0;
    while (a == 0) {
        a += rand() * time(NULL);
        float c = 1 / a;

        for (int b = 20; !setjmp(env); b -= 21) {
            if ((a / b) < 20)
                c *= c;

            if (c == a)
                longjmp(env, 0);
            /*
             * Your code here.
             */
        }
    }
}