从右到左直接取余除以10循环就可
但是反方向就要设一个变量取最大位,最近有点感悟记录下来
#include <stdio.h>
main(){
int n;
char a;
while((a=getchar())!='\n')
{
n=a-'0';
}
从右到左直接取余除以10循环就可
但是反方向就要设一个变量取最大位,最近有点感悟记录下来
#include <stdio.h>
main(){
int n;
char a;
while((a=getchar())!='\n')
{
n=a-'0';
}