题解 | #数字颠倒#
数字颠倒
https://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
#include <stdio.h> int main() { int a = 0,i = 0; scanf("%d",&a); if(a == 0) { printf("%d",a); } int arr[32] = {0}; while(a!=0) { arr[i++] = a%10; a /= 10; } for(int j = 0;j<i;j++) { printf("%d",arr[j]); } return 0; }