标签:log namespace ret std cout from class output 数字
1 #include <iostream> 2 #include <string.h> 3 using namespace std; 4 int main() 5 { 6 char a[100]; 7 int i,j,n,temp; 8 cout<<"input numbers:"<<endl; 9 gets(a); 10 n=strlen(a); 11 for(j=0;j<n-1;j++) 12 for(i=0;i<n-j-1;i++) 13 if(a[i]>a[i+1]) 14 { 15 temp=a[i]; 16 a[i]=a[i+1]; 17 a[i+1]=temp; 18 } 19 cout<<"from small to large output the numbers :"<<endl; 20 for(i=0;i<n;i++) 21 cout<<a[i]<<" "; 22 23 return 0; 24 }
标签:log namespace ret std cout from class output 数字
原文地址:http://www.cnblogs.com/programmer-monkey2271971745/p/6056566.html