#include <stdio.h>
#include <string.h>int data[30]; // 数据
int poly[30]; // 生成式int main(){char str[30];// 输入数据scanf("%s", str);int data_len = strlen(str);for (int i = 0; i < data_len; i++){data[i] = str[i] - '0';}// 输入生成式scanf("%s", str);int crc_len = strlen(str);for (int i = 0; i < crc_len; i++){poly[i] = str[i] - '0';}// 补0for (int i = 0; i < crc_len-1; i++){data[data_len+i] = 0;}// 模2除法for (int i = 0; i < data_len;){int start = i;for (int j = 0; j < crc_len; j++){data[start+j]^=poly[j];}// 去中间结果的头部0,对齐除数while (data[start] == 0)start++;i = start;}// 输出余数for (int i = data_len; i < data_len+crc_len-1; i++){printf("%d", data[i]);}}