/* bubble sort and print function with string param*/ #include #include using namespace std; void bubblesort(int [], int); void printarray(int a[], int SIZE, string s); int main(int argc, char *argv[]) { int SIZE=10; string s1,s2; int a[] = {62, 18, 24, 15, 100, 27, 89, 38, 45, 34}; int i, pass, temp; s1="O dedomenos pinakas"; printarray(a,SIZE,s1); bubblesort(a,SIZE); s2="O taksinomhmenos pinakas"; printarray(a,SIZE,s2); system("PAUSE"); return 0; } void bubblesort(int a[], int SIZE) { int temp; for (int pass = 1; pass <= SIZE - 1; pass++) { for (int i = 0; i <= SIZE - pass - 1; i++) if (a[i] > a[i + 1]) { temp = a[i]; a[i] = a[i + 1]; a[i + 1] = temp; } } } void printarray(int a[], int SIZE, string s) {cout<