Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- #include<algorithm>
- using namespace std;
- int arr[10000],arr2[10000],z,h,temp,e,p,r,y;
- char x,v,w,q,a,b;
- int bola()
- {
- scanf("%d",&p);
- for(int i=1;i<=p;i++)
- {
- scanf("%d",&arr[i]);
- }
- for(int j=1;j<=p;j++)
- {
- scanf("%d",&arr2[j]);
- }
- scanf("%d",&r);
- for( int f=1;f<=r;f++)
- {
- swap(arr[z],arr2[h]);
- }
- for(int k=1;k<=p;k++)
- {
- printf("%d ",arr[k]);
- }
- printf("\n");
- for(int u=1;u<=p;u++)
- {
- printf("%d ",arr2[u]);
- }
- printf("\n");
- }
- int main()
- {
- bola();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement