UVA-10499 The Land of Justice
UVA-10499 The Land of Justice
题目大意:商品不按照体积而是按照表面积来计算价格,第一刀无法切开,第二刀多了四个半圆面,之后每刀多两个半圆面。给出所切的刀数,输出增加表面积的比率。
Sample Input
2
2
-1
Sample Output
50%
50%
解题思路:
第一刀无法切开,第二刀多了四个半圆面,之后每刀多两个半圆面
原始面积:4 × PI × r × r
一个半圆面:PI × r × r / 2
每刀增加两个半圆面即 1 / 4 化为百分数即 *25。
#include <iostream>
#include <cstdio>
using namespace std;int main() {long long n;while (scanf("%lld",&n), n > 0) {if (n == 1)printf("0%%\n");elseprintf("%lld%%\n",25 * n);}return 0;
}
UVA-10499 The Land of Justice相关推荐
- UVA10499 The Land of Justice 的题解
UVA10499 The Land of Justice 的题解 UVA传送门 题目大意 有一个球体,将其分成 n n n 份以后,表面积增加了百分之多少?输入以一个负数结尾,该负数不参与计算. 思路 ...
- UVA, 516 Prime Land
题意:给一个数的指数形式,例:5 1 2 1 num=5^1*2^1 求num-1的质因数分解结果 思路:素数筛法,质因数分解 代码如下: 1 #include <iostream> ...
- UVA 516 Prime Land
UVA516 感觉自己的思维不够灵动变通...特别是写了最近的几道题目之后...感觉得做出加倍努力不然真的就学不进去了..我太难了. #include <iostream> #includ ...
- 提取了下刘汝佳推荐的题号...
今天闲来没事上uva oj提取了下刘汝佳推荐的acm题号,原始数据如下: Volume 0. Getting Started 10055 - Hashmat the Brave Warrior ...
- Competitive Programming 3题解
题目一览: Competitive Programming 3: The New Lower Bound of Programming Contests(1) Competitive Programm ...
- AOAPC I: Beginning Algorithm Contests 题解
AOAPC I: Beginning Algorithm Contests 题解 AOAPC I: Beginning Algorithm Contests (Rujia Liu) - Virtual ...
- π-Algorithmist分类题目(1)
原题网站:Algorithmist,http://www.algorithmist.com/index.php/Main_Page π-Algorithmist分类题目(1) Sorting UVAL ...
- 紫书《算法竞赛入门经典》
紫书<算法竞赛入门经典>题目一览 第3章 数组和字符串(例题) UVA 272 TEX Quotes UVA 10082 WERTYU UVA 401 Palindromes UVA 34 ...
- 初学者acm的练习题指南
上机练习题参考题 忘了在哪找的啦~~希望对大家有帮助呦 <!--[if !supportLists]-->1. <!--[endif]-->Programming Bas ...
最新文章
- 33 多线程同步之Condition
- 哪些情况下索引会失效?
- C++ Primer 5th笔记(chap 16 模板和泛型编程)默认模板实参
- Android list转xml
- GIT学习----第六节:撤销修改
- CentOS下安装Tomcat并配置JRE
- python signal
- Linux取消挂载,删除用户及其目录
- vc语言c1083错误,VC Fatal Error C1083的几种解决方案
- 【ros】初学ROS的学习笔记——创建Publisher
- chrome 未连接到互联网 代理服务器出现问题,或者地址有误
- Reactor构架模式
- Web 函数自定义镜像实战:构建图象处理函数
- 与IBM谈判搁浅 Sun及其CEO前景存疑
- 手持式设备产品的设计与交互
- springboot运行出现 错误: 找不到或无法加载主类 com.xxxx.xxxx.Application
- js ajax上传文件功能
- Julia 学习笔记(五) | 模块开发 - 保姆级教程
- 服务器系统盘清理工具,Windows添加磁盘清理工具的方法
- 数据分享|全球河湖矢量数据集(2010)