#include <stdio.h>
#include <string.h>
int main(void){
FILE *in;
FILE *out;
unsigned int BLOCK_SIZE = 3;
char block[BLOCK_SIZE];
in = fopen("input.txt", "rt");
if(in == NULL){ fputs("File error", stderr); return 1; }
out = fopen("output.txt", "wt");
if(out == NULL){ fputs("File error", stderr); return 1; }
while(!feof(in)){
memset(block, 0, sizeof(block));
if(fread(block, sizeof(char), BLOCK_SIZE, in) != 0){
fwrite(block, sizeof(char), BLOCK_SIZE, out);
//!!!!!!!!
for(int i = 0; i < BLOCK_SIZE; i++){
printf("%d", block[i]);
printf(" ");
}
printf("\n");
int mark = 0;
for(int i = 0; i < BLOCK_SIZE; i++){
mark += block[i]*(2 << (BLOCK_SIZE - 1 - i));
}
printf("%d", mark);
printf("\n");
}
}
fclose(in);
fclose(out);
int p;
scanf("%d", p);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCgppbnQgbWFpbih2b2lkKXsKICAgIEZJTEUgKmluOwogICAgRklMRSAqb3V0OwogICAgdW5zaWduZWQgaW50IEJMT0NLX1NJWkUgPSAzOwogICAgY2hhciBibG9ja1tCTE9DS19TSVpFXTsKICAgIAogICAgaW4gPSBmb3BlbigiaW5wdXQudHh0IiwgInJ0Iik7CiAgICBpZihpbiA9PSBOVUxMKXsgZnB1dHMoIkZpbGUgZXJyb3IiLCBzdGRlcnIpOyByZXR1cm4gMTsgfQogICAgCiAgICBvdXQgPSBmb3Blbigib3V0cHV0LnR4dCIsICJ3dCIpOwogICAgaWYob3V0ID09IE5VTEwpeyBmcHV0cygiRmlsZSBlcnJvciIsIHN0ZGVycik7IHJldHVybiAxOyB9CiAgICAKICAgIHdoaWxlKCFmZW9mKGluKSl7CiAgICAgICAgbWVtc2V0KGJsb2NrLCAwLCBzaXplb2YoYmxvY2spKTsKICAgICAgICBpZihmcmVhZChibG9jaywgc2l6ZW9mKGNoYXIpLCBCTE9DS19TSVpFLCBpbikgIT0gMCl7CiAgICAgICAgICAgIGZ3cml0ZShibG9jaywgc2l6ZW9mKGNoYXIpLCBCTE9DS19TSVpFLCBvdXQpOwogICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAvLyEhISEhISEhCiAgICAgICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBCTE9DS19TSVpFOyBpKyspewogICAgICAgICAgICAgICAgcHJpbnRmKCIlZCIsIGJsb2NrW2ldKTsKICAgICAgICAgICAgICAgIHByaW50ZigiICIpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHByaW50ZigiXG4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgIGludCBtYXJrID0gMDsKICAgICAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IEJMT0NLX1NJWkU7IGkrKyl7CiAgICAgICAgICAgICAgICBtYXJrICs9IGJsb2NrW2ldKigyIDw8IChCTE9DS19TSVpFIC0gMSAtIGkpKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBwcmludGYoIiVkIiwgbWFyayk7CiAgICAgICAgICAgIHByaW50ZigiXG4iKTsKICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgCiAgICB9CiAgICAKICAgIGZjbG9zZShpbik7CiAgICBmY2xvc2Uob3V0KTsKICAgIAogICAgaW50IHA7CiAgICBzY2FuZigiJWQiLCBwKTsKfQ==