2011 阿里巴巴 1003

来源:互联网 发布:校园网网络工程设计书 编辑:程序博客网 时间:2024/06/16 04:01
#include <stdio.h>
#include <string.h>
#include <stdlib.h>


int main()
{
    int T;
    char a[101],b[101];
    while(scanf("%d",&T)!=EOF){
        for(int i = 1 ;i <= T; i++){
            scanf("%s%s",a,b);
            int x = 0,y = 0;
            for(int i = 0; i < strlen(a);i++)
            {
                x += a[i]-48;
            }
            for(int i = 0; i < strlen(b);i++)
            {
                y += b[i]-48;
            }
            printf("Case %d: %d\n",i,x+y);
        }


    }
    return 0;
}
原创粉丝点击