aside note: the array of strings ends of ‘\0’;
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
char a[10],b[10];char d_a,d_b;cin>>a>>d_a>>b>>d_b;int sum_a = 0,sum_b = 0 ;for(int i = 0 ;i < strlen(a) ; i ++){
if( a[i] == d_a){
int num = d_a - '0';sum_a = sum_a*10+num;}}for(int i = 0 ;i < strlen(b) ; i ++){
if( b[i] == d_b){
int num = d_b - '0';sum_b = sum_b*10+num;}}cout<<sum_a+sum_b<<endl;//cout<<a<<" "<<d_a<<" "<<b<<" "<<d_b;return 0;
}