Compare commits
No commits in common. "5192fdec49613cb0e33ebccff66711b90c159a4e" and "240fdc1e1fe80e0ce66390299b0f153290aa6b33" have entirely different histories.
5192fdec49
...
240fdc1e1f
17
prim.c
17
prim.c
@ -3,7 +3,8 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#define typ long long int
|
#define typ long long int
|
||||||
|
|
||||||
bool foo(typ* x){
|
|
||||||
|
bool is_it_a_prim(typ* x){
|
||||||
int k = 2;
|
int k = 2;
|
||||||
while(k < *x){
|
while(k < *x){
|
||||||
if(*x % k == 0)
|
if(*x % k == 0)
|
||||||
@ -13,18 +14,18 @@ k++;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(void){
|
int main(void){
|
||||||
typ fn = 0, fn_1 = 1, fn_2 = 0;
|
typ fn = 0, fn_1 = 1, fn_2 = 0;
|
||||||
|
int i = 2;
|
||||||
printf("%llu",ULONG_MAX);
|
while(fn < LLONG_MAX)
|
||||||
|
|
||||||
while(fn < ULONG_MAX)
|
|
||||||
{
|
{
|
||||||
fn = (typ)fn_1 + (typ)fn_2;
|
fn = fn_1 + fn_2;
|
||||||
if(foo(&fn))
|
if(is_it_a_prim(&fn))
|
||||||
printf("%llu\n",fn);
|
printf("%d\t%llu\n",i ,fn);
|
||||||
fn_2 = fn_1;
|
fn_2 = fn_1;
|
||||||
fn_1 = fn;
|
fn_1 = fn;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user