Miko


私信TA

用户名:uq_72395336682

访问量:1061

签 名:

为了梦想,淦就完了。

等  级
排  名 21197
经  验 649
参赛次数 0
文章发表 12
年  龄 20
在职情况 学生
学  校 四川职业技术学院
专  业 软件技术

  自我简介:

在下菜笔一枚。

TA的其他文章

解题思路:

注意事项:

参考代码:

#include<stdio.h>


int main()

{

int x,x1,x2,n=0;

int i;

scanf("%d",&x);

x1=x2=x;

while(x>0)

{

n++;

x=x/10;

}

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

if(n==1)

{

printf("%d",x1);

}

else if(n==2)

{

printf("%d %d",x1/10,x1%10);

}

else if(n==3)

{

printf("%d %d %d",x1/100,x1/10%10,x1%10);

}

else if(n==4)

{

printf("%d %d %d %d",x1/1000,x1/100%10,x1/10%10,x1%10);

}

else if(n==5)

{

printf("%d %d %d %d %d",x1/10000,x1/1000%10,x1/100%10,x1/10%10,x1%10);

}

if(n==1)

{

printf("%d",x1);

}

else if(n==2)

{

printf("\n%d",x1%10*10+x1/10);

}

else if(n==3)

{

printf("\n%d",x1%100%10*100+x1%100/10*10+x1/100);

}

else if(n==4)

{

printf("\n%d",x1%1000%100%10*1000+x1%1000%100/10*100+x1/100%10*10+x1/1000);

}

else if(n==5)

{

printf("\n%d",x1/10000+x1/1000%10*10+x1/100%100%10*100+x1/10%1000%100%10*1000+x1%10*10000);

}

return 0;

}


 

0.0分

0 人评分

  评论区

暴力法
2021-03-12 09:52:02
  • «
  • 1
  • »