Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
#include <iostream>
using namespace std;
int main()
{
const int max_n = 100;
int A[max_n], n;
cout << "Ile liczb chcesz posortować? (max=100) \n";
cin >> n;
cout << "Wprowadź liczby " << endl;
for (int i = 0; i < n; i++)
{
cout << "A[" << i << "] = ";
cin >> A ;
}
cout << "Tabela przed sortowaniem:" << endl;
for (int i = 0; i < n; i++)
cout << A << " ";
int i, j, pom;
for (i = 1; i <= n; i++)
{
for (j = n-1; j >= i; j--)
{
if (A[j] < A[j-1])
{
pom = A[j-1];
A[j-1] = A[j];
A[j] = pom;
}
}
}
cout << "\nTabela po sortowaniu:" << endl;
for (i = 0; i < n; i++)
cout << A << " ";
}