Sliencer


私信TA

用户名:Bruce0hh

访问量:1607

签 名:

等  级
排  名 22327
经  验 611
参赛次数 0
文章发表 1
年  龄 0
在职情况 学生
学  校
专  业

  自我简介:


#include<stdio.h>

#include<stdlib.h>

int main()

{

int i, k, t, m, n = 0;

int a[5];

scanf("%d", &i);//输入5位以下的数字

k = i; m = i;

while (i>0)

{

n++;

i /= 10;

}

printf("%d\n", n);

//输出数字共几位



for (t=0 ; t<n ; t++ )

{

a[t] = m % 10;

m /= 10;

}

for (t = n-1; t >= 0; t--)

{

printf("%d",a[t]);

while (t != 0)

{

printf(" ");

break;

}

}

printf("\n");

//顺序输出每一位数字



while (k>0)

{

t = k % 10;

printf("%d", t);

k /= 10;

}

//逆序输出数字

system("pause");

return 0;

}


 

0.0分

2 人评分

  评论区