FZU 2089 数字游戏

水题,不过感觉数据有错。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<iostream>
using namespace std;

long long a,b;

int main()
{
    int T;
    scanf("%d",&T);
    while(T--)
    {
        scanf("%lld%lld",&a,&b);
        long long c=a+b;
        if(c<0) c=-c;

        int ans=0;
        while(c)
        {
            if(c%10==5) ans++;
            c=c/10;
        }
        printf("%d
",ans);
    }
    return 0;
}
原文地址:https://www.cnblogs.com/zufezzt/p/5242610.html