kedaOJ#P0017. [NOIP2011普及组] 数字反转
题目#P0017. [NOIP2011普及组] 数字反转
思路
无
代码
#include <stdio.h>
int main() {
int x, s = 0;
scanf("%d", &x);
if (x < 0) {
printf("-");
x = x * (-1);
}
while (x > 0) {
s = s * 10 + x % 10;
x = x / 10;
}
printf("%d", s);
return 0;
}
这是mcr130102的博客,转载请注明出处