#include <iostream>
using namespace std;
const int N = 100;
int main()
{
int tabP[ N ];
int tabNP[ N ];
int a, n, lnp = 0, lp = 0;
for( int i = 0; i < N; i++ )
{
tabP[ i ] = 0;
tabNP[ i ] = 0;
}
for( int i = 0; a != 0; ++i )
{
cout << "Podaj liczbe nr " << i + 1 << " :";
cin >> a;
if( a % 2 == 0 ) {
tabP[ i ] = a;
lp++;
} else
{
tabNP[ i ] = a;
lnp++;
}
}
// wypisywanie
cout << "Tablica elementow parzystych " << endl;
for( int i = 0; i < lp; i++ )
cout << "tab[" << i + 1 << "] = " << tabP[ i ] << endl;
cout << "Tablica elementow nieparzystych " << endl;
for( int i = 0; i < lnp; i++ )
cout << "tab[" << i + 1 << "] = " << tabNP[ i ] << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKY29uc3QgaW50IE4gPSAxMDA7CmludCBtYWluKCkKewogICAgaW50IHRhYlBbIE4gXTsKICAgIGludCB0YWJOUFsgTiBdOwogICAgaW50IGEsIG4sIGxucCA9IDAsIGxwID0gMDsKICAgIAogICAgZm9yKCBpbnQgaSA9IDA7IGkgPCBOOyBpKysgKQogICAgewogICAgICAgIHRhYlBbIGkgXSA9IDA7CiAgICAgICAgdGFiTlBbIGkgXSA9IDA7CiAgICB9CiAgICBmb3IoIGludCBpID0gMDsgYSAhPSAwOyArK2kgKQogICAgewogICAgICAgIGNvdXQgPDwgIlBvZGFqIGxpY3piZSBuciAiIDw8IGkgKyAxIDw8ICIgOiI7CiAgICAgICAgY2luID4+IGE7CiAgICAgICAgaWYoIGEgJSAyID09IDAgKSB7CiAgICAgICAgICAgIHRhYlBbIGkgXSA9IGE7CiAgICAgICAgICAgIGxwKys7CiAgICAgICAgfSBlbHNlCiAgICAgICAgewogICAgICAgICAgICB0YWJOUFsgaSBdID0gYTsKICAgICAgICAgICAgbG5wKys7CiAgICAgICAgfQogICAgfQogICAgCiAgICAvLyB3eXBpc3l3YW5pZQogICAgCiAgICAKICAgIGNvdXQgPDwgIlRhYmxpY2EgZWxlbWVudG93IHBhcnp5c3R5Y2ggIiA8PCBlbmRsOwogICAgZm9yKCBpbnQgaSA9IDA7IGkgPCBscDsgaSsrICkKICAgIAogICAgICAgICBjb3V0IDw8ICJ0YWJbIiA8PCBpICsgMSA8PCAiXSA9ICIgPDwgdGFiUFsgaSBdIDw8IGVuZGw7CiAgICAKICAgIAogICAgY291dCA8PCAiVGFibGljYSBlbGVtZW50b3cgbmllcGFyenlzdHljaCAiIDw8IGVuZGw7CiAgICBmb3IoIGludCBpID0gMDsgaSA8IGxucDsgaSsrICkKICAgIAogICAgICAgICBjb3V0IDw8ICJ0YWJbIiA8PCBpICsgMSA8PCAiXSA9ICIgPDwgdGFiTlBbIGkgXSA8PCBlbmRsOwogICAgCiAgICByZXR1cm4gMDsKfQ==