A+B

 #include<stdio.h>
#include<stdlib.h>
#include<string.h>
char s1[15], s2[15];
long long int abc ( char *s ) {
 long long int sum;
 int length = strlen ( s );
 for ( int i = 0; i < length; i++ ) {
    if ( s[i] == ',' ) {
    for ( int j = i; j < length-1 ; j++  ) {
       s[j] = s[j+1]; 
    }  
    s[length-1] = '\0';
       } 
 }
 sum = atoi (s);
 return sum;
}
int main()
{  
 long long int a, b;
 while ( scanf ( "%s%s", s1, s2 ) != EOF ) {
    long long int a, b;
    a = abc (s1); b = abc (s2);
    printf ( "%I64d\n", a+b );
 }
    return 0;
}
 
原文地址:https://www.cnblogs.com/QQbai/p/2135266.html