hdu 2186 悼念512汶川大地震遇难同胞——一定要记住我爱你

/*x 抢险小分队
y 医疗小分队
z 通信小分队*/
/*
x=n/2;
y=(n-x)*2/3;
z=n-x-y;
cntx,cnty,cntz;
*/
#include

int result(int x)
{
	if(x%10!=0)
	return x/10+1;
	else
	return x/10;
}

int main()
{
	int x,y,z;
	int cntx,cnty,cntz;
	int n,t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&n);
		x=n/2;
        y=(n-x)*2/3;
        z=n-x-y;
        cntx=result(x);
        cnty=result(y);
        cntz=result(z);
        printf("%d\n",cntx+cnty+cntz);
	}
	return 0;
}

你可能感兴趣的:(acm-基础题)