数字翻转
#include<stdio.h>//循环实践 int main() { int oldNumber,newNumber,digitNumber,iniValue; newNumber=0; printf("input your number:\n"); scanf("%d",&iniValue); oldNumber=iniValue; while(oldNumber!=0) { digitNumber=oldNumber%10; newNumber=newNumber*10+digitNumber; oldNumber=oldNumber/10; } printf("%d converse is %d",iniValue,newNumber); return 0; }
原文地址:https://www.cnblogs.com/jiangzenghui/p/12427328.html
时间: 2024-10-19 13:39:00