Buenas quisiera pedir ayuda con un proyecto que tengo que hacer es generar un rango numerico de 10 digitos y guardarlo en un archivo, intente hacer algo en c++ pero los vectores no me permiten procesar numeros tan grandes. Que podria implementar?, tendria que hacerlo en otro lenguaje si alguien tiene una sugerencia se lo agradeceria
#include <iostream>
#include <fstream>
using namespace std;
int main() {
int cedu=123266;
int cedula[cedu], ced[cedu],
pares[cedu], impares[cedu], total[cedu],
dec[cedu], dectotal[cedu];
int a[cedu] ,b[cedu] ,c[cedu] ,d[cedu] ,e[cedu] ,f[cedu] ,g[cedu] ,h[cedu] ,i[cedu] ,j[cedu];
int n, m=0;
for (n=0; n<123266; n++){
cout<<"Ingrese su cedula n: "<<n<<endl;
cedula[n]=n;
ced[n]=cedula[n];
a[n]=cedula[n]/1000000000;
cedula[n]=cedula[n]-(a[n]*1000000000);
b[n]=cedula[n]/100000000;
cedula[n]=cedula[n]-(b[n]*100000000);
c[n]=cedula[n]/10000000;
cedula[n]=cedula[n]-(c[n]*10000000);
d[n]=cedula[n]/1000000;
cedula[n]=cedula[n]-(d[n]*1000000);
e[n]=cedula[n]/100000;
cedula[n]=cedula[n]-(e[n]*100000);
f[n]=cedula[n]/10000;
cedula[n]=cedula[n]-(f[n]*10000);
g[n]=cedula[n]/1000;
cedula[n]=cedula[n]-(g[n]*1000);
h[n]=cedula[n]/100;
cedula[n]=cedula[n]-(h[n]*100);
i[n]=cedula[n]/10;
cedula[n]=cedula[n]-(i[n]*10);
j[n]=cedula[n]/1;
cedula[n]=cedula[n]-(j[n]*1);
//cout<<cedula<<endl<<a<<endl<<b<<endl<<c<<endl<<d<<endl<<e<<endl<<f<<endl<<g<<endl<<h<<endl<<i<<endl<<j<<endl;
if (cedula[n]>2400000000){
cout<<"Numero de cedula invalido."<<endl;
}
else{
pares[n]=b[n]+d[n]+f[n]+h[n];
a[n]=a[n]*2;
if (a[n]>9){
a[n]=a[n]%10+a[n]/10;
}
c[n]=c[n]*2;
if (c[n]>9){
c[n]=c[n]%10+c[n]/10;
}
e[n]=e[n]*2;
if (e[n]>9){
e[n]=e[n]%10+e[n]/10;
}
g[n]=g[n]*2;
if (g[n]>9){
g[n]=g[n]%10+g[n]/10;
}
i[n]=i[n]*2;
if (i[n]>9){
i[n]=i[n]%10+i[n]/10;
}
impares[n]=a[n]+c[n]+e[n]+g[n]+i[n];
total[n]=pares[n]+impares[n];
}
dec[n]=0;
while (dec[n]-total[n]!=j[n] && dec[n]<total[n]+10){
dec[n]=dec[n]+10;
dectotal[n]=dec[n]-total[n];
}
}
ofstream fs("Cedula.txt");
cout<<endl;
for (n=0; n<123266; n++){
m++;
if (dectotal[n]==j[n]){
ced[m]=ced[n];
if(a[n]==0){
cout<<"0"<<ced[m]<<endl;
fs<<"0"<<ced[m]<<endl;
}
else{
cout<<ced[m]<<endl;
fs<<ced[m]<<endl;
}
}
else{
}
}
fs.close();
return 0;
}
Hasta aca solo procesa 123266 números