Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i,a,z,xr,n,ca,cz,max1,j,k;
- cin>>n;
- for (k=0;k<n;k++){
- cin>>a;
- ca=a;
- z=a%4+1;
- if(z==1)
- z=5;
- // printf("(%d)",z);
- cz=z;
- xr=0;
- while(z>0){
- xr=xr^a;
- a--;
- z--;
- }
- cout<<xr<<" ";
- /*z=cz;a=ca;max1=xr;
- for(i=0;i<z;i++){
- xr=0;
- for(j=0;j<i;j++)
- xr=xr^(a-j);
- for(j=i+1;j<z;j++)
- xr=xr^(a-j);
- max1=max(xr,max1);
- }
- cout<<max1<<"\n";*/
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement