#include<iostream> using namespace std; void queue(char a[]) { while(cin>>a) { int b[3]; b[0]=a[0]; b[1]=a[1]; b[2]=a[2]; for(int i=0;i<3;i++) for(int j=i+1;j<3;j++) { if(b[i]>b[j]) { char temp1=0; int temp2=0; temp1=a[i]; a[i]=a[j]; a[j]=temp1; temp2=b[i]; b[i]=b[j]; b[j]=temp2; } } cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl; } } int main() { char a[3]; queue(a); return 0;}
![]()
杭电2000 ( ASCII码排序 )
最新推荐文章于 2024-07-22 09:38:37 发布