请问当n = 1200会出现溢出,该怎么改啊,
# include <iostream># include <stdlib.h>
# include <cstdio>
# include <cmath>
using namespace std;
int a[1800] = {1};
int cmp(const void* a, const void* b)
{
return *(int*)a - *(int *)b;
}
int main()
{
int i, j, k, x = 1,n;
for(k = 0; k < 12; k ++ )
for(j = 0; j < 12; j ++ )
for(i = 0; i < 12; i ++ )
{
a[x] = pow(2,i)*pow(3,j)*pow(5,k);
x ++ ;
}
qsort(a,1729,sizeof(a[0]),cmp);
while(cin >> n && n != 0)
{
cout<<a[n]<<endl;
//printf("%I64d", a[n]);
}
return 0;
}