#include <iostream>
#include <math.h>
#include <iomanip>

using namespace std;

unsigned __int64 Fib(int n);

double f_sqrt(const double a )
{ double Res; Res = sqrt(a); return  Res;}

unsigned __int64 Fib_nth(int n);

unsigned __int64 Fib_nth1(int n);


int main()
{
    //cout.setf(ios::fixed, ios::floatfield);
    //cout.setf(ios::showpoint);
        int i, n;
        i = n = 0;

        cout << " Number of iterations: ";
        cin >> n;
                cout << Fib(n) << endl;

				
		cout << " Find the nth Fibonacci number , type n :"<< endl;
		cin >> n;
		unsigned __int64 r;unsigned __int64 s;
		r = Fib_nth(n);
		cout << " The "<< n <<"th number is :"<< r << endl;
		if(n>25) cout <<" The next number is right , perhaps not the the previous ...\n";
        s = Fib_nth1(n);
		
		
        getchar();
        char ze;cin>> ze;
}

unsigned __int64 Fib(int n)
{
       unsigned  __int64 a = 0 ;unsigned __int64 b = 1 ;unsigned __int64 c ;unsigned __int64 n1 ;
       c = a + b ;
       for ( n1 = 3 ; n1 <= n ; n1 ++ )
       { a = b ; b = c ; c = a + b ;
       cout<< " Fib "<< n1<<" = "<< c<< endl;
	   if( n1==93 ) cout<<" \n After fib93 , the numbers are wrong ...\n";}
	   
       return c;
       
       
}

unsigned __int64 Fib_nth(int n)
{
unsigned __int64 Res ;
Res = ( 1 / (f_sqrt(5)) ) * ( pow((( 1 + f_sqrt(5) ) / 2 ), n)- pow( (( 1 - f_sqrt(5) ) / 2 ), n) );
return Res;
}
unsigned __int64 Fib_nth1(int n)
{  
	   unsigned  __int64 a = 0 ;unsigned __int64 b = 1 ;unsigned __int64 c ;unsigned __int64 n1 ;
       c = a + b ;
       for ( n1 = 3 ; n1 <= n ; n1 ++ )
       { a = b ; b = c ; c = a + b ;
       if( n1==n )cout<< " Fib "<< n1<<" = "<< c<< endl;
	   if( n1>=93 ) cout<<" \n After fib93 , the numbers are wrong ...\n";}
	   
       return c;
} 

     

Doubly linked list (4 files)

C++ again, for finding one root of a third degree equation and checking the result , it often works fine :

For finding the 93 first Fibonacci numbers very fast , after 93 iterations it is false :

A linked list for practising :

For finding the binary representation of a number using bits :

For finding the binary representation of a number using maths :

hexadecimal representation of a number using maths :

hexadecimal representation of a number using bits :

for well understanding the structure of a linked list, here is a simple one:

It was a long and difficult linked list, but apparently, it works. Below are some other pages of code in C++, exercises most of the time. I have also put some of my plugins for 3dsmax.

I learned maxscript before learning C++, here are some scripts or plugins I did:

Next, there is some linear algebra and funny matrices:

This is now a script for enciphering and deciphering messages.

Here is an example of enciphered message. If I tell you that the 2 primes are 431 and 743 , with my script above you surely can translate the following message: 62520 172480 147764 226702 42110 58127 123996 256203 196716 181614 299597 181614 241357 187604 32762 17311 309478 29630 301116 153664 113777 14703

C++LANGUAGE
 
basicperson.h
aperson.h
aperson.cpp
ofstream.cpp
 
 
 
 
maxplugins
 
thirddegree.cpp
 
fibonacci.cpp
 
linkedlist.cpp
 
binary1
 
binary2
 
BACKHOME
 
hex1
 
hex2
 
simpleLinkedList
 
determinantmatrix
 
QRdecomposition
 
cryptography