limits added
This commit is contained in:
parent
1461320339
commit
9eba8b5e33
6
prim.c
6
prim.c
@ -1,5 +1,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <limits.h>
|
||||||
#define typ unsigned long long
|
#define typ unsigned long long
|
||||||
|
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ return true;
|
|||||||
|
|
||||||
int main(void){
|
int main(void){
|
||||||
typ int fn = 0, fn_1 = 1, fn_2 = 0;
|
typ int fn = 0, fn_1 = 1, fn_2 = 0;
|
||||||
for(int i=0;i<700;i++)
|
while(fn < ULLONG_MAX)
|
||||||
{
|
{
|
||||||
fn = fn_1 + fn_2;
|
fn = fn_1 + fn_2;
|
||||||
if(is_it_a_prim(&fn))
|
if(is_it_a_prim(&fn))
|
||||||
@ -24,6 +25,5 @@ printf("%llu\n",fn);
|
|||||||
fn_2 = fn_1;
|
fn_2 = fn_1;
|
||||||
fn_1 = fn;
|
fn_1 = fn;
|
||||||
}
|
}
|
||||||
getchar();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user