HDU 1985 Conversions
来源:互联网 发布:辐射4 捏脸数据 编辑:程序博客网 时间:2024/06/06 18:40
http://acm.hdu.edu.cn/showproblem.php?pid=1985
Conversions
Time Limit: 1000/500 MS(Java/Others)
Total Submission(s):844
Problem Description
Conversion between the metric andEnglish measurement systems is relatively simple. Often, itinvolves either multiplying or dividing by a constant. You mustwrite a program that converts between the following units:
Input
The first line of input contains asingle integer N, (1 ≤ N ≤ 1000) which is the number of datasetsthat follow.
Each dataset consists of a single line of input containing afloating point (double precision) number, a space and the unitspecification for the measurement to be converted. The unitspecification is one of kg, lb, l, or g referring to kilograms,pounds, liters and gallons respectively.
Each dataset consists of a single line of input containing afloating point (double precision) number, a space and the unitspecification for the measurement to be converted. The unitspecification is one of kg, lb, l, or g referring to kilograms,pounds, liters and gallons respectively.
Output
For each dataset, you should generateone line of output with the following values: The dataset number asa decimal integer (start counting at one), a space, and theappropriately converted value rounded to 4 decimal places, a spaceand the unit specification for the converted value.
Sample Input
5 1 kg 2 l7 lb 3.5 g 0 l
Sample Output
1 2.2046 lb2 0.5284 g 3 3.1752 kg 4 13.2489 l 5 0.0000 g
Source
2008 “Shun Yu Cup” Zhejiang Collegiate Programming Contest - WarmUp(1)
Recommend
linle
题目大意:一些单位的转换。
分析:甚至不用看表格,直接用题中给的样例就可以计算所有单位之间的转换率,简单题。
代码如下:
#include<stdio.h>#include<string.h>
int main()
{
}
阅读全文
0 0
- HDU 1985 Conversions
- HDU 1242 Rescue
- ZZULI_SummerPractice(3) HDU 1…
- HDU 1579 Function Run Fun
- HDU 1405 The Last Practice
- HDU 2050 折线分割平面
- hdu 1000 A + B Problem
- HDU 1075 What Are You Talking …
- HDOJ 1171 Big Event in HDU
- hdu 1216 Assistance Required
- hdu 1225 Football Score
- HDU:1060 Leftmost Digit
- HDU 1030 Delta-wave
- HDU 1232 畅通工程
- HDU 2102 A计划
- HDU 4287 Intelligent IME
- hdu 1001 Sum Problem
- hdu 2039 三角形 /…
- HDU 2061 Treasure the new start,…
- Vue.js-----轻量高效的MVVM框架(九、组件利用Props传递数据)
- HDU 2060 Snooker
- Cloudera Apache Hadoop 管理员培训—助力进阶大数据知识与技能
- CentOS7使用firewalld打开关闭防火墙与端口
- HDU 1985 Conversions
- Tomcat 可以localhost访问,但不能127.0.0.1访问(转)
- HDU 1977 Consecutive sum II
- HDU 1976 Software Version
- 移动端布局页面实现
- angularjs表头排序
- HDU 1877 又一版 A+B
- HDU 1862 EXCEL排序
- HDU 1859 最小长方形