martes, 14 de febrero de 2012

Project Euler 24

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int myints[] = {0,1,2,3,4,5,6,7,8,9};
    reverse(myints,myints+10);
    for(int i=0; i<1000000; i++)
    {
        next_permutation (myints,myints+10);
    }

    cout << myints[0] << myints[1]  << myints[2] <<  myints[3]<< myints[4] <<  myints[5]<< myints[6]<< myints[7]<< myints[8]<<myints[9]<<endl;

    return 0;
}




No hay comentarios:

Publicar un comentario