杭电acm2186
http://acm.hdu.edu.cn/showproblem.php?pid=2186
能被10整除就直接除,不能的话就除完再加一
#include<stdio.h> int main() { int c,n,sum,q,y,t; scanf("%d",&c); while(c--) { scanf("%d",&n); q=n/2; n-=q; y=n*2/3; t=n-y; sum=0; if(q%10==0) sum+=q/10; else sum+=q/10+1; if(t%10==0) sum+=t/10; else sum+=t/10+1; if(y%10==0) sum+=y/10; else sum+=y/10+1; printf("%d\n",sum); } return 0; }