Compare commits

..
4 Commits
+9 -8
View File
@@ -1,10 +1,9 @@
#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
#define typ unsigned long long
#define typ long long int
bool is_it_a_prim(typ* x){
bool foo(typ* x){
int k = 2;
while(k < *x){
if(*x % k == 0)
@@ -14,13 +13,15 @@ k++;
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;
printf("%llu",ULONG_MAX);
while(fn < ULONG_MAX)
{
fn = fn_1 + fn_2;
if(is_it_a_prim(&fn))
fn = (typ)fn_1 + (typ)fn_2;
if(foo(&fn))
printf("%llu\n",fn);
fn_2 = fn_1;
fn_1 = fn;