toj 4065 The Coco-Cola Store

时间限制(普通/Java):1000MS/3000MS 内存限制:65536KByte
总提交: 131 测试通过:95

描述

Once upon a time, there is a special coco-cola store. If you return three empty bottles to the shop, you’ll get a full bottle of coco-cola to drink. If you have n empty bottles right in your hand, how many full bottles of coco-cola can you drink?

输入

There will be at most 10 test cases, each containing a single line with an integer n (1<=n<=100). The input terminates with n = 0, which should not be processed.

输出

For each test case, print the number of full bottles of coco-cola that you can drink.

样例输入

3
10
81
0

样例输出

1
5
40

#include <cstdio>using namespace std;int main() {int n;while(scanf("%d", &n) && n != 0) {int res = 0;while(n >= 0) {int bottle = n / 3;res += bottle;int retain = n % 3;n = bottle + retain;if(n == 2) {res++;break;} else if(n == 1 || n == 0) {break;}}printf("%d\n", res);}return 0;
}

toj 4065 The Coco-Cola Store相关推荐

  1. map评价吗 voc数据集可以用coco_【庖丁解牛】从零实现RetinaNet(九):使用COCO预训练权重在VOC上训练RetinaNet...

    下列代码均在pytorch1.4版本中测试过,确认正确无误. 如何载入COCO预训练权重 由于其他数据集如VOC的类别数不一定和COCO数据集相同,载入COCO预训练权重后要先去掉和类别有关的卷积层权 ...

  2. COCO数据集提取自己需要的类,转VOC

    github:https://github.com/zcc720/COCO2VOC.git 原文地址:http://www.manongjc.com/article/28607.html 接上篇VOC ...

  3. 将coco数据集格式转变成voc数据格式

    记录一下 ["person","bicycle","car","motorcycle","airplane&q ...

  4. UVA11150 Cola【数学】

    You see the following special offer by the convenience store: "A bottle of Choco Cola for every ...

  5. Microsoft COCO: Common Objects in Context - 目标检测评估 指标(Detection Evaluation)

    参考博客 coco官网 coco目标检测评估指标 以下12个指标用于描述COCO上的对象检测器的性能: Average Precision (AP): AP % AP at IoU=.50:.05:. ...

  6. MS COCO数据集详解

    这是我的推广信息,以激励自己更好的分享自己的知识和经验!也希望看到的你能够多多支持,谢谢! 1. 滴滴云AI大师: 目前滴滴云正在大力推广自己的云计算服务,需要购买的朋友们用我的AI大师码 「2049 ...

  7. coco evaluate

    指标含义 参考 https://zhuanlan.zhihu.com/p/60707912 mmap的解释: 给定一组IOU阈值,在每个IOU阈值下面,求所有类别的AP,并将其平均起来,作为这个IOU ...

  8. COCO数据集josn转txt格式

    1.coco_2104数据集 2.json格式转xml 3.xml转txt格式 思路: 把coco_train2014.json文件转换为xml; coco_label-6.py:将xml格式文件转换 ...

  9. 目标检测coco数据集点滴介绍

    目标检测coco数据集点滴介绍 COCO数据集介绍 MS COCO 是google 开源的大型数据集, 分为目标检测.分割.关键点检测三大任务, 数据集主要由图片和json 标签文件组成. coco数 ...

最新文章

  1. pandas使用groupby函数对dataframe进行分组统计、使用as_index参数设置分组聚合的结果中分组变量不是dataframe的索引(index)
  2. acwing 327. 玉米田
  3. signature=08653706deda7871a1f662eae4d2b33e,The nature of nuclear Halpha emission in LINERs
  4. zs040蓝牙模块使用方法_如何使用车载蓝牙播放手机音乐的方法
  5. String,StringBuilder, StringBuffer
  6. bash 历史记录_您将实际使用的7个Bash历史记录快捷方式
  7. OJ和PTA常见的错误代码含义
  8. 根据线性递推的DP公式如何写出变换矩阵
  9. 邢波老师致广大学员的一封信(2010-10-26)
  10. prometheus.yml 配置文件参数详解
  11. 2018美赛C题翻译
  12. Ubuntu 安装 ROS 详细教程
  13. ArcGIS中高风险地区热力图制作
  14. tplink迷你路由器中继模式_TP-Link无线路由器中继模式设置教程
  15. upnp 文件服务器,upnp服务器
  16. wordpress博客设置赞赏和内容会员可见以及跨境电商独立站
  17. 阿里聚安全 博客 ------安卓动态调试七种武器之长生剑
  18. Android开机自启自动轮播图片或自动轮播视频APP
  19. Unity5.3官方VR教程重磅登场-系列6 VR真机测试和产品发布
  20. linux ll命令是什么

热门文章

  1. .NET进行客户端Web开发又一利器 - Ant Design Blazor
  2. 聊聊rocketmq的ConsumerIdsChangeListener
  3. 【Python】GUI编程(Tkinter)教程
  4. 输入一个三位正整数,输出百位数,十位数,个位数
  5. freelance平台_完整的Freelance Web开发人员指南:如何通过Freelance编程工作来赚钱
  6. 程序员为什么觉得会议很无聊_我从100个无聊的会议中学到的难忘的教训
  7. magic feature_停止将PostgREST称为“ MAGIC”!
  8. 遗传算法编码方式整数编码_如何编码卫星算法并从头开始烹制西班牙海鲜饭
  9. 宏定义中有浮点数_GEO是什么?还可以定义新的数据类型吗?
  10. Labview 模型导入Veristand问题