HDU4788_Hard Disk Drive
水题。 但是我写挫了一个地方,Wa了三发。好吧,不能忍了。
还有,本屌不知道如何用printf输出%,哪位学过C++的大仙知道这是什么情况? 告诉我一声啊。
#include <iostream>
#include <cstdio>
#define eps 1e-12
using namespace std; double ans;
int t,k,n,cas=;
char s[]; int main()
{
scanf("%d",&t);
while (t--)
{
scanf("%d%s",&n,s);
if (s[]=='B') k=;
else if (s[]=='K') k=;
else if (s[]=='M') k=;
else if (s[]=='G') k=;
else if (s[]=='T') k=;
else if (s[]=='P') k=;
else if (s[]=='E') k=;
else if (s[]=='Z') k=;
else if (s[]=='Y') k=;
ans=;
while (--k) ans/=1.024;
printf("Case #%d: %.2f",++cas,-ans+eps);cout<<"%"<<endl;
}
return ;
}
HDU4788_Hard Disk Drive的更多相关文章
- [Ubuntu] Error: The disk drive for /media/sda2 is not ready yet or not present
After updated Ubuntu, and reboot, I got these error The disk drive for /media/sda2 is not ready yet ...
- HDU 4788 Hard Disk Drive (2013成都H,水题)
Hard Disk Drive Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- HDUOJ----(4788)Hard Disk Drive
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission ...
- go语言 os.Rename() cannot move the file to a different disk drive 怎么办
时值我小病在家休养生息,喜欢跳广场舞的外公来寻求我的帮助,他们跳广场舞是将存有歌曲的U盘插到音响上面,而音响大部分都是只能显示歌曲的索引index,不能直接显示歌曲名,所以为了方便他们会在U盘里面对歌 ...
- HDU - 4788 Hard Disk Drive (成都邀请赛H 水题)
HDU - 4788 Hard Disk Drive Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I ...
- Hard Disk Drive(MBR)
这里讲的主要是网上所谓的老式磁盘,它是由一个个盘片组成的,我们先从个盘片结构讲起.如图1所示,图中的一圈圈灰色同心圆为一条条磁道,从圆心向外画直线,可以将磁道划分为若干个弧段,每个磁道上一个弧段被称之 ...
- HDU 4788 Hard Disk Drive (2013成都H,水题) 进位换算
#include <stdio.h> #include <algorithm> #include <string.h> #include<cmath> ...
- hdu 4788 Hard Disk Drive (水题)
题意: Input The first line contains an integer T, which indicates the number of test cases. For each t ...
- Disk IO Performance
一,使用 Performance counter 监控Disk IO问题 1,Physical Disk vs. Logical Disk Windows可以在一个Physical Disk上划出若干 ...
随机推荐
- WPF 任务栏颜色 - 简书
原文:WPF 任务栏颜色 - 简书 先看看效果,这种效果可以用来做进度条或者消息通知闪烁. image.png image.png image.png image.png 有一个好消息 ...
- 【转】odoo学习之:开发字段解析
odoo新API中,字段类型不变,继承改变 1.旧的API定义模型: from openerp.osv import osv,fields class oldmodel(osv.osv): #模型名称 ...
- day 2 函数的嵌套
1.函数的嵌套 百度百科 2.产品如何运作 3.应用 1)版本1:打印1条线 #1.定义函数 def print_line(): print("-"*50) #2.调用函数 ...
- 属性文件操作之Properties与ResourceBundle
1.Properties与ResourceBundle 两个类都可以读取属性文件中以key/value形式存储的键值对,ResourceBundle读取属性文件时操作相对简单. 2.Propertie ...
- Qt 将字符串转成16进制显示
最近项目用到了需要将字符串转换成16进制显示.这玩意折腾了一上午. 首先,数据块内容 struct UserData { char Head[3] = {'X','J','J'}; char Flag ...
- 【springmvc+mybatis项目实战】杰信商贸-7.生产厂家新增
我们要实现新的功能,就是生产厂家的新增先来回顾一下系统架构图我们数据库这边已经建好表了,接下来要做的就是mapper映射 编辑FactoryMapper.xml文件,加入“添加”的逻辑配置代码块 &l ...
- Memcached&PHP-Memcache安装配置
参考文档: memcache官网:https://memcached.org/ 参考:http://www.runoob.com/memcached/memcached-install.html 参考 ...
- 简述AQS原理
这是一道面试题:简述AQS原理 AQS核心思想是,如果被请求的共享资源空闲,则将当前请求资源的线程设置为有效的工作线程,并且将共享资源设置为锁定状态.如果被请求的共享资源被占用,那么就需要一套线程阻塞 ...
- 算法笔记(c++)--c++中碰到的一些用法
算法笔记(c++)--c++中碰到的一些用法 toupper(xxx)可以变成大写; tolower(xx)小写 isalpha(xxx)判断是不是字母 isalnum(xx)判断是不是数字 abs( ...
- 无法设置主体sa的凭据
设置允许SQL Server身份登录 1.先用Window方式登陆进去,选择数据库实例,右键选择属性——安全性:把服务器身份验证选项从“Window身份验证模式”改为“SQLServer和Window ...