HDU2186

2019-05-30

19:31:10

水题

#include 
using namespace std;
int main()
{
    int c;
    scanf("%d", &c);
    while(c--)
    {
        int n;
        int sum = 0;
        scanf("%d", &n);
        int a = n / 2;
        int b = (n - a) * 2 / 3;
        int c = n - a - b;
        if(a % 10 == 0)
        {
            sum += a/10;
        }
        else
        {
            sum += (a/10) + 1;
        }
        
        if(b % 10 == 0)
        {
            sum += b/10;
        }
        else
        {
            sum += (b/10) + 1;
        }
        if (c % 10 == 0)
        {
            sum += c / 10;
        }
        else
        {
            sum += (c / 10) + 1;
        }
        cout << sum <<endl;
    }

    return 0;
}

 

转载于:https://www.cnblogs.com/Artimis-fightting/p/10951807.html

你可能感兴趣的:(HDU2186)