From 48dac3fb2d1139c8a26e53111ce01ab5ac6483c5 Mon Sep 17 00:00:00 2001 From: Alexander Resnik Date: Wed, 3 Jul 2019 04:51:12 +0200 Subject: [PATCH] =?UTF-8?q?now=20signed=20and=20xx=20th=20fibonacci=C2=B4n?= =?UTF-8?q?umber?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- prim.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/prim.c b/prim.c index 6d64cdb..6adbd4f 100644 --- a/prim.c +++ b/prim.c @@ -1,7 +1,7 @@ #include #include #include -#define typ unsigned long long +#define typ long long int bool is_it_a_prim(typ* x){ @@ -16,14 +16,16 @@ return true; int main(void){ -typ int fn = 0, fn_1 = 1, fn_2 = 0; -while(fn < ULLONG_MAX) +typ fn = 0, fn_1 = 1, fn_2 = 0; +int i = 2; +while(fn < LLONG_MAX) { fn = fn_1 + fn_2; if(is_it_a_prim(&fn)) -printf("%llu\n",fn); +printf("%d\t%llu\n",i ,fn); fn_2 = fn_1; fn_1 = fn; +i++; } return 0; }