" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
#include <algorithm>
using namespace std;
int t[3];
int main() {
cin >> t[0] >> t[1] >> t[2];
sort (t, t + 3);
cout << t[0] << " " << t[1] << " " << t[2] << endl;
}
#include <iostream>
using namespace std;
int main(){
int tab[3];
int zmienna;
for (int i=0; i<3; i++)
{
cout << "Podaj liczbe nr: " << i++ << " ";
cin>>tab[i];
}
for (int i=0; i<3; i++)
{
for (int j=0; j<3; j++)
{
if (tab[i]>tab[i++])
{
zmienna = tab[i];
tab[i]=tab[i++];
tab[i++]=zmienna;
}
}
}
for (int k=0; k<3; k++)
{
cout <<tab[k] << " ";
}
getchar();
cin.ignore();
return 0;
}