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("%c\n", "0");
		    end
			c = $fgetc(`STDIN);
			d = 0;
			i = 1;
		end
	end
endmodule

stdin

01111101
00000011
00110111
00000110
00000011
10111110
00000001
00100100
01001110
11100111
00001111
01110100
01011011
00101101
10011001
00010101
11100011
10011111
11001110
01101001
10010010
10001000
01101000
00000000
11100001
00001010
10010110
01010011
11111101
10101011
11010010
11011000
10110010
11010001
10000010
11011010
11001111
00101000
01111000
10100001
11000101
10001000
11011110
00011100
10001100
01000010
01001001
00011010
10111101
00011101

stdout

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

stderr

strace