#include int deci(int); int main(void){ /* 変数の宣言 */ int binary1,binary2; int decimal = 0; int base = 1; /* 10進数の入力 */ scanf("%d", &binary1); scanf("%d", &binary2); int m,n; /* 変換した2進数の出力 */ m = deci(binary1); n = deci(binary2); printf("%d",m+n); return 0; } int deci(int binary){ int decimal = 0; int base = 1; /* 2進数を10進数に変換 */ while(binary>0){ decimal = decimal + ( binary % 10 ) * base; binary = binary / 10; base = base * 2; } return decimal; }