Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,j;
- cin>>t;
- for(j=0; j<t; j++)
- {
- int i,pos[100],a;
- for(i=0;; i++)
- {
- cin>>a;
- if(a>-1)
- pos[i]=a;
- else
- break;
- }
- int len=i;
- float num[100],ar[100];
- for(i=0; i<len; i++)
- {
- cin>>num[i];
- }
- for(i=0; i<len; i++)
- {
- ar[pos[i]-1]=num[i];
- }
- cout<<"Output is"<<endl;
- for(i=0; i<len; i++)
- cout<<ar[i]<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement