" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
using namespace std;
int main()
{
int tab[10];
for(int i=0;i<10;i++)
{
cout<<"Podaj "<<i+1<<" liczbe: ";
cin>>tab[i];
}
//
int temp;
for(int i=1;i<10;i++)
{
for(int j=1;j<10;j++)
{
if(tab[j]<tab[j-1])
{
temp=tab[j];
tab[j]=tab[j-1];
tab[j-1]=temp;
}
}
}
cout<<endl<<"Tablica po sortowaniu: "<<endl;
for(int i=0;i<10;i++)
{
cout<<tab[i]<<endl;
}
return 0;
}