Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 10:
- {
- system("clear");
- cout<<"10. Szétválogatás tétele(páratlan, páros)"<<endl;
- cout<<"A tömb adatai: "<<endl;
- cout<<"n="<<n<<endl;
- cout<<"A tömb elemei: ";
- for(int i=0; i<n; i++)
- {
- cout<<setw(n)<<x[i];
- }
- cout<<endl;
- n1=0;
- n2=0;
- for(int i=0; i<n; i++)
- {
- if(x[i]%2==1)
- {
- x1[n1]=x[i];
- n1++;
- }
- else
- {
- x2[n2]=x[i];
- n2++;
- }
- }
- cout<<"Az x1 tömb adatai: "<<endl;
- cout<<"n1= "<<n1<<endl;
- cout<<"Az x1 tömb elemei: ";
- for(int i=0; i<n1; i++)
- {
- cout<<setw(4)<<x1[i];
- }
- cout<<endl;
- cout<<"Az x2 tömb adatai: "<<endl;
- cout<<"n2= "<<n2<<endl;
- cout<<"Az x2 tömb elemei: ";
- for(int i=0; i<n2; i++)
- {
- cout<<setw(4)<<x2[i];
- }
- cout<<endl;
- cin>>get;
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement