输入一个正整数n,找出其中最小数字,用该数字组成一个新数,新数的位数与原数相

学习 时间:2026-10-10 07:10:45 阅读:9381
输入一个正整数n,找出其中最小数字,用该数字组成一个新数,新数的位数与原数相输入一个正整数n,找出其中最小数字,用该数字组成一个新数,新数的位数与原数相同。运行示例:Enter an integer:2187The new integer:1111C语言编程作业

最佳回答

超帅的大叔

懦弱的白云

2026-10-10 07:10:45

#include “stdio。h”void main(){int x,minnum,t,len;printf("Enter an integer:");scanf("%d",&x);minnum=x%10;len=1;while(x>=10){x=x/10;t=x%10;len++;if(t0){t=10*t+minnum;len--; }printf("The new Integer:%d\n",t);}

最新回答共有2条回答

  • 冷静的小懒虫
    回复
    2026-10-10 07:10:45

    #include “stdio。h”void main(){int x,minnum,t,len;printf("Enter an integer:");scanf("%d",&x);minnum=x%10;len=1;while(x>=10){x=x/10;t=x%10;len++;if(t0){t=10*t+minnum;len--; }printf("The new Integer:%d\n",t);}

上一篇 He isn't as taller as his brother.改错

下一篇 最浪漫的句子..英文的中文的都要