什麽乱七八糟的,while循环你都把n搞成0了啊。while循环前面的printf输出了n,然后最后printf输出了0-->倒置值,所以才出现现在的输出效果。while前面的printf语句删掉,改为定义一个变量等于n,比如 int m=n;最后printf第一个输出变量将n改为m就行了