c语言中显示正整数逆转之后的值
作者:互联网
001、
#include <stdio.h> int main(void) { int i; int result = 0; printf("i = "); scanf("%d", &i); while(i > 0) { result = result * 10 + i % 10; i /= 10; } printf("result = %d\n", result); return 0; }
标签:10,正整数,语言,int,void,result,printf,main,逆转 来源: https://www.cnblogs.com/liujiaxin2018/p/16584707.html