c++设计一个程序,输入一个三位正整数,输出其各位数字组成的最大整数,如,输入123,输出321!
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/09/20 18:52:18
c++设计一个程序,输入一个三位正整数,输出其各位数字组成的最大整数,如,输入123,输出321!
#include
using namespace std ;
int main()
{
int n;
int unit,tens,hund;
cin >> n ;
unit = n%10 ;
tens= n/10%10;
hund=n/100;
if ( hund < tens ) { int temp=hund;hund=tens;tens=temp; }
if ( hund < unit ) { int temp=hund;hund=unit;unit=temp; }
if ( tens < unit ) { int temp=tens;tens=unit;unit=temp; }
cout
using namespace std ;
int main()
{
int n;
int unit,tens,hund;
cin >> n ;
unit = n%10 ;
tens= n/10%10;
hund=n/100;
if ( hund < tens ) { int temp=hund;hund=tens;tens=temp; }
if ( hund < unit ) { int temp=hund;hund=unit;unit=temp; }
if ( tens < unit ) { int temp=tens;tens=unit;unit=temp; }
cout
c++设计一个程序,输入一个三位正整数,输出其各位数字组成的最大整数,如,输入123,输出321!
有没有C语言大神啊,帮写个程序呗.输入一个五位数的正整数,按顺序输出组成该整数的各位数字!
求解c语言题:输入一个任意的三位数,将其各位数字反序输出(例如输入123,输出321).
设计一个算法,输入一个正整数后输出这个正整数各位数字的立方和
编写一个程序输入一个3位正整数要求反向输出对应的整数如输入123则输出321.编写程序并给出相应的流程图.
编写程序,输入一个三位整数,把三个数字逆序组成一个新数,再输出.例如输入369,输出963.
c++语言:输入一个三位整数,计算各位数字的立方和,并输出
编写程序:输入一个4位的整数,然后分别输出组成改4位数的各位数字.
C语言输入一个整数 并把这个整数各位数字由大到小重新排列组成的整数输出
设计一个程序,要求输入三个整数,能求出其中最大的数并输出
设计一个程序,输入一个四位数(整数),将各位数字分开,并按期反序输出.例如:输入1234,则输出4321
设计一个程序,输入一个四位数(整数),将各位数字分开,并按期反序输出.例如:输入1234,则输出4321.