srand (time (0));
const int size = 10;
int A[size];
cout << "Massive A:" << endl;
for (int i = 0; i < size; i++) {
}
int temp = 0;
for (int i = 0; i < size; i++) {
}
cout << endl << "Sort massive:" << endl;
for (int i = 0; i < size; i++)
system("pause");
const int size = 10;
int A[size];
cout << "Massive A:" << endl;
for (int i = 0; i < size; i++) {
A[i] = rand () % 201 - 100;
cout << A[i] << "\t";
}
int temp = 0;
for (int i = 0; i < size; i++) {
for (int j = 1; j < size - i; j++) {
if (A[j - 1] > A[j]) {}
temp = A[j];}
A[j] = A[j - 1];
A[j - 1] = temp;
}
cout << endl << "Sort massive:" << endl;
for (int i = 0; i < size; i++)
cout << A[i] << "\t";
system("pause");
Комментариев нет:
Отправить комментарий