题解 | #数字颠倒#
数字颠倒
http://www.nowcoder.com/practice/ae809795fca34687a48b172186e3dafe
除数取余法,很简单。
# include<iostream> using namespace std; int main() { int n; scanf("%d", &n); int num; do { num = n%10; printf("%d",num); n/=10; }while(n); return 0; }