题解 | #kiki算数#

kiki算数

http://www.nowcoder.com/practice/bcaf710fb58a44e1b678a890e6e90d7c

int delete(int a)
{
    int b = a;
    int c = a;
    int count = 0;
    while (a > 0)
    {
        a = a / 10;
        count++;
    }
    int arr[20] = { 0 };
    for (int i = 0; i < count; i++)
    {
        arr[i] = b % 10;
        b = b / 10;

    }
   
    if (c> 100)
    {
        c= c % 100;
        if (arr[1] == 0)
        {
            c = c % 10;
        }
    }
    else {
        c = c;
    }
    return c;
}
int sum(int a, int b)
{
    int c = a + b;
    int d = c;
    if (c >= 100)
    {
        c = c % 100;
        d = c;
    }
    else {
        d = d;
    }
    return d;

}
int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    int c = delete(a);
    int d = delete(b);
    int sum1 = sum(c, d);
    printf("%d", sum1);
    return 0;
}
全部评论

相关推荐

三年之期已到我的offer快到碗里来:9硕都比不上9本
点赞 评论 收藏
分享
1 收藏 评论
分享
牛客网
牛客企业服务