#include using namespace std; const int N=10; int main() { int a[N],i,nb,tmp; for(i=0;i<N;i++) {cout<<"Veuillez taper l'entier numero "<<i<<" : ";cin>>a[i];} do { nb=0; for(i=0;i<N-1;i++) if(a[i]>a[i+1]) { tmp=a[i];a[i]=a[i+1];a[i+1]=tmp; nb++; } }while(nb!=0); cout<<"VOICI LE TABLEAU TRIE :"<<endl; for(i=0;i<N;i++)cout<<"a["<<i<<"]="<<a[i]<<endl; return 0; }
- Wednesday
- January 22nd, 2025
- Ajouter un cours