c++设计一个程序,输入一个三位正整数,输出其各位数字组成的最大整数,如,输入123,输出321!

日期:2013-03-23 21:23:58 人气:2

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; }
    A+
热门评论