

				C++ - Bubble sort			
							
					Ahoj! Mohli byste mi, prosím, říct, kde mám v tomhle prográmku chybu? To pole to prostě nechce setřídit a netuším proč :D
#include<iostream>
#include<ctime>
using namespace std;
//1
int pole[5];
//2
void nahodna_cisla(){
	for(int i = 0; i < 5; ++i){
		pole[i] = rand() % 9;
	}
}
//3
void serazeni(){
	bool oprava;
	do{
		oprava = true;
		for(int i = 0; i <= 4; ++i){
			if(pole[i] > pole [i+1]){
				int pom;
				pom = pole[i+1];
				pole[i+1] = pole[i];
				pole[i] = pom;
				oprava = false;
			}
		}
	}while(oprava = false);
}
int main(){
	srand(time(NULL));
	//2 volani funkce nahodna_cisla
	nahodna_cisla();
	//vypis nesetrideneho pole
	for(int i = 0; i < 5; ++i){
		cout << pole[i] << " ";
	}
	cout << endl;
	serazeni();
	//vypis setrideneho pole
	for(int i = 0; i < 5; ++i){
		cout << pole[i] << " ";
	}
return 0;
}Moc díky za odpovědi 
 Pro zdrojáky tu máme tag CODE. (host)