Result

WA

Code [DL]

`define EOF 32'hFFFF_FFFF
`define STDIN 32'h8000_0000

module cat;
	integer c,i,d;
	initial begin
		c = $fgetc(`STDIN);
		i = 1;
		d = 0;
		while (c != `EOF) begin
			while ( i < 256)begin
				d = d + (c - 48) * i;
				i =  i * 2;
				c = $fgetc(`STDIN);
			end
			i = 1;
			while(d > 0)begin 
				d = d - i;
				i = i + 1;
			end
			if ( d == 0)begin
				$write("%c\n", "1");
		    end else begin
		    	$write("%d\n", 0);
		    end
			c = $fgetc(`STDIN);
			d = 0;
			i = 1;
		end
	end
endmodule

stdin

10100100
00011100
00000001
01011011
01100111
11011100
11100110
10011001
11111010
00010101
10011011
10101011
10001001
11010101
01011111
11111111
11011001
11100111
00000110
01111000
00000000
01000010
01011011
10000010
00001111
10011110
11111000
00000011
00110111
00001101
00100100
11101010
11101100
11010010
11111101
10001000
00011101
11111110
10111100
01101001
10001110
10111110
00110111
01001011
01101000
00100001
01001110
00101101
00001010
10100110

stdout

0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
1
0
0
1
1
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0

stderr

strace