aboutsummaryrefslogtreecommitdiffstats
path: root/overcomplicated_loop.c
blob: 06d8849e39c68774786bc990c62967eb141e7863 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * ???
 *
 * Copyright (C) 2014  Tomasz Kramkowski <tk@the-tk.com>
 *
 * This program is free software. It is licensed under version 3 of the
 * GNU General Public License.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see [http://www.gnu.org/licenses/].
 */

// I don't remember.

#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.
             */
        }
    }
}