求助:int变a[]
unsigned long int a=213121122012;要变成int c[];
c[0]=2; c[1]=1; c[2]=3; c[3]=1.......c[11]=2;
代码怎么写?
int main() { unsigned long long a = 213121122012; unsigned long long b = a; int c[20], len = 0, t; while (b) { c[len++] = b % 10; b /= 10; } for (int i = 0; i < len / 2; i++) { t = c[i]; c[i] = c[len - i - 1]; c[len - i - 1] = t; } for (int i = 0; i < len; i++) { printf("c[%d]=%d; ", i, c[i]); } return 0; }