HDU2186
2019-05-30
19:31:10
水题
#include <bits/stdc++.h>
using namespace std;
int main()
{
int c;
scanf("%d", &c);
while(c--)
{
int n;
int sum = ;
scanf("%d", &n);
int a = n / ;
int b = (n - a) * / ;
int c = n - a - b;
if(a % == )
{
sum += a/;
}
else
{
sum += (a/) + ;
} if(b % == )
{
sum += b/;
}
else
{
sum += (b/) + ;
}
if (c % == )
{
sum += c / ;
}
else
{
sum += (c / ) + ;
}
cout << sum <<endl;
} return ;
}
HDU2186的更多相关文章
- OJ题目分类
POJ题目分类 | POJ题目分类 | HDU题目分类 | ZOJ题目分类 | SOJ题目分类 | HOJ题目分类 | FOJ题目分类 | 模拟题: POJ1006 POJ1008 POJ1013 P ...
- hdu 2186
#include <iostream> using namespace std; int main() { int a,b,c,k1,k2,k3,m,n; cin>>m; wh ...
随机推荐
- GCD & Operation queues & Thread
One of the technologies for starting tasks asynchronously is Grand Central Dispatch (GCD). This tech ...
- C# 返回值为 list<T>
public List<T> test<T>(List<T> EntityList) where T : class { return EntityList; }
- Python 递归、匿名函数、map和filter day4
一.递归---函数自己调用自己 1.一个错误递归的例子: count=0 def hello(): global count count+=1 print("count %s"%c ...
- Day 13 进程和线程
进程和线程 今天我们使用的计算机早已进入多CPU或多核时代,而我们使用的操作系统都是支持“多任务”的操作系统,这使得我们可以同时运行多个程序,也可以将一个程序分解为若干个相对独立的子任务,让多个子任务 ...
- uva 1583 Digit Generator(Uva-1583)
题目不再写入了,vj:https://vjudge.net/problem/UVA-1583#author=0 主要讲的是找一个数的小于它的一个数,小于它的那个数每一位加起来再加上那个数就会等于原来的 ...
- BZOJ 3572 [HNOI2014]世界树 (虚树+DP)
题面:BZOJ传送门 洛谷传送门 题目大意:略 细节贼多的虚树$DP$ 先考虑只有一次询问的情况 一个节点$x$可能被它子树内的一个到x距离最小的特殊点管辖,还可能被管辖fa[x]的特殊点管辖 跑两次 ...
- C#学习笔记_09_构造方法/函数
09_构造方法/函数 代码案例 作用:构造函数主要是用来创建对象时为对象赋初值来初始化对象:总与new运算符一起使用在创建对象的语句中,例如A a=new A(); 特点: 构造函数具有和类一样的名称 ...
- Python-基本语法元素
#TempConvert.py TempStr = input("请输入带有符号的温度值: ") if TempStr[-1] in ['F', 'f']: C = (eval(T ...
- ssm 数据库连接池配置
1.工程引入druid-1.1.2.jar包2.修改spring-common.xml文件 <!-- 1. 数据源 : DruidDataSource--> <bean id=&qu ...
- 【codeforces 509C】Sums of Digits
[题目链接]:http://codeforces.com/contest/509/problem/C [题意] 给你一个数组b[i] 要求一个严格升序的数组a[i]; 使得a[i]是b[i]各个位上的 ...