1 #include <iostream> 2 using namespace std; 3 int main() 4 { 5 int a[3],i,j,t; 6 for(i=0;i<=2;i++) 7 cin>>a[i]; 8 for(j=0;j<=2;j++) 9 for(i=0;i<=3-i;i++) 10 if(a[i]>a[i+1]) 11 {t=a[i];a[i]=a[i+1];a[i+1]=t;} 12 for(i=0;i<=2;i++) 13 cout<<a[i]<<" "; 14 cout<<endl; 15 return 0; 16 }
时间: 2024-10-29 19:11:09