Compare commits
1
Commits
master
..
747d70d1d7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
747d70d1d7 |
@@ -1,9 +1,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#define typ long long int
|
#define typ unsigned long long
|
||||||
|
|
||||||
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,15 +14,13 @@ k++;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(void){
|
int main(void){
|
||||||
typ fn = 0, fn_1 = 1, fn_2 = 0;
|
typ int fn = 0, fn_1 = 1, fn_2 = 0;
|
||||||
|
while(fn < ULLONG_MAX)
|
||||||
printf("%llu",ULONG_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("%llu\n",fn);
|
||||||
fn_2 = fn_1;
|
fn_2 = fn_1;
|
||||||
fn_1 = fn;
|
fn_1 = fn;
|
||||||
|
|||||||
Reference in new issue
Block a user