//the code is as follows
package test;
//import java.lang.Integ er;
/**
*
* @author Niket
*/
public class Main {
public static void main(String[] args) {
int set=0;
byte one = 1;
String s = new String();
s = "ponmlkjihgfedc ba";
byte b[] = s.getBytes();
for(int i=0; i<b.length; i++)
System.out.prin t((char)b[i] + " ");
System.out.prin tln();
for(int i=0; i<=25;i++) { //for 25 circular left shifts
byte t[]= b; // temp array for each left shift
for(int j=0;j<16;j++){
if(t[j]<0) //checks if msb==1
set=1;
b[(j+1)%16]<<=1;
if(set==1)
b[(j+1)%16]|=one;//if msb of previous is one then lsb of nxt is set to one otherwise default is anyways 0
}
for(int k=0; k<b.length; k++)
System.out.prin t(b[k]+" ");
System.out.prin tln();
}
for(int i=0; i<b.length; i++)
System.out.prin t(b[i] + " ");
}
}
//the output is anomalous and is as follows:
//been breaking our heads on this so PLEASE HELP!!
/*According to our calculations the final output after the 25 iterations is
-56 -54 -52 -50 -48 -46 -44 -42 -40 -38 -36 -34 -62 60 -58*/
p o n m l k j i h g f e d c b a
-31 -34 -35 -37 -39 -41 -43 -45 -47 -49 -51 -53 -55 -57 -59 -61
-61 -67 -69 -73 -77 -81 -85 -89 -93 -97 -101 -105 -109 -113 -117 -121
-121 123 119 111 103 95 87 79 71 63 55 47 39 31 23 15
15 -9 -17 -33 -49 -65 -81 -97 -113 127 111 95 79 63 47 31
31 -17 -33 -65 -97 127 95 63 31 -1 -33 -65 -97 127 95 63
63 -33 -65 127 63 -1 -65 127 63 -1 -65 127 63 -1 -65 127
127 -65 127 -1 127 -1 127 -1 127 -1 127 -1 127 -1 127 -1
-1 127 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
package test;
//import java.lang.Integ er;
/**
*
* @author Niket
*/
public class Main {
public static void main(String[] args) {
int set=0;
byte one = 1;
String s = new String();
s = "ponmlkjihgfedc ba";
byte b[] = s.getBytes();
for(int i=0; i<b.length; i++)
System.out.prin t((char)b[i] + " ");
System.out.prin tln();
for(int i=0; i<=25;i++) { //for 25 circular left shifts
byte t[]= b; // temp array for each left shift
for(int j=0;j<16;j++){
if(t[j]<0) //checks if msb==1
set=1;
b[(j+1)%16]<<=1;
if(set==1)
b[(j+1)%16]|=one;//if msb of previous is one then lsb of nxt is set to one otherwise default is anyways 0
}
for(int k=0; k<b.length; k++)
System.out.prin t(b[k]+" ");
System.out.prin tln();
}
for(int i=0; i<b.length; i++)
System.out.prin t(b[i] + " ");
}
}
//the output is anomalous and is as follows:
//been breaking our heads on this so PLEASE HELP!!
/*According to our calculations the final output after the 25 iterations is
-56 -54 -52 -50 -48 -46 -44 -42 -40 -38 -36 -34 -62 60 -58*/
p o n m l k j i h g f e d c b a
-31 -34 -35 -37 -39 -41 -43 -45 -47 -49 -51 -53 -55 -57 -59 -61
-61 -67 -69 -73 -77 -81 -85 -89 -93 -97 -101 -105 -109 -113 -117 -121
-121 123 119 111 103 95 87 79 71 63 55 47 39 31 23 15
15 -9 -17 -33 -49 -65 -81 -97 -113 127 111 95 79 63 47 31
31 -17 -33 -65 -97 127 95 63 31 -1 -33 -65 -97 127 95 63
63 -33 -65 127 63 -1 -65 127 63 -1 -65 127 63 -1 -65 127
127 -65 127 -1 127 -1 127 -1 127 -1 127 -1 127 -1 127 -1
-1 127 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -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