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);
		while (c != `EOF) begin
			while (! ( c == 48 || c == 49 || c == `EOF)) begin 
				c = $fgetc(`STDIN);				
			end
			d = 0;
			i = 1;
			while ( c == 48 || c == 49)begin
				d = d + (c - 48) * i;
				i =  i * 2;
				c = $fgetc(`STDIN);
			end
		    $write("%d\n", d);
			i = 1;
			while(d > 0)begin 
				d = d - i;
				i = i + 1;
			end

			if ( d == 0 )begin
				// $write("%c\n", "0");
		    end else begin
		    	// $write("%c\n", "1");
		    end
		end
	end
endmodule

stdin

00001010
10101011
11011010
01101000
11100111
10011100
00111010
11111101
11111100
00010101
11000111
11000011
00110100
01001110
01111000
01011001
00010001
10101011
10111110
10001000
11010001
10101100
01000010
10011001
00110111
00101101
00011100
00000000
00000001
00101011
00011010
10011110
11010101
01010100
00000110
00011100
00100100
01110100
01101001
00001111
01011011
11110101
11010010
00000011
10100101
00110011
00100011
00011111
11111001
10001100

stdout

         80
        213
         91
         22
        231
         57
         92
        191
         63
        168
        227
        195
         44
        114
         30
        154
        136
        213
        125
         17
        139
         53
         66
        153
        236
        180
         56
          0
        128
        212
         88
        121
        171
         42
         96
         56
         36
         46
        150
        240
        218
        175
         75
        192
        165
        204
        196
        248
        159
         49
          0

stderr

strace