STL--B - Hardwood Species
来源:互联网 发布:个人下载网站源码 编辑:程序博客网 时间:2024/05/22 02:24
B - Hardwood Species
Description
Hardwoods are the botanical group of trees that have broad leaves, produce a fruit or nut, and generally go dormant in the winter.
America's temperate climates produce forests with hundreds of hardwood species -- trees that share certain biological characteristics. Although oak, maple and cherry all are types of hardwood trees, for example, they are different species. Together, all the hardwood species represent 40 percent of the trees in the United States.
On the other hand, softwoods, or conifers, from the Latin word meaning "cone-bearing," have needles. Widely available US softwoods include cedar, fir, hemlock, pine, redwood, spruce and cypress. In a home, the softwoods are used primarily as structural lumber such as 2x4s and 2x6s, with some limited decorative applications.
Using satellite imaging technology, the Department of Natural Resources has compiled an inventory of every tree standing on a particular day. You are to compute the total fraction of the tree population represented by each species.
Input
Output
Sample Input
Red AlderAshAspenBasswoodAshBeechYellow BirchAshCherryCottonwoodAshCypressRed ElmGumHackberryWhite OakHickoryPecanHard MapleWhite OakSoft MapleRed OakRed OakWhite OakPoplanSassafrasSycamoreBlack WalnutWillow
Sample Output
Ash 13.7931Aspen 3.4483Basswood 3.4483Beech 3.4483Black Walnut 3.4483Cherry 3.4483Cottonwood 3.4483Cypress 3.4483Gum 3.4483Hackberry 3.4483Hard Maple 3.4483Hickory 3.4483Pecan 3.4483Poplan 3.4483Red Alder 3.4483Red Elm 3.4483Red Oak 6.8966Sassafras 3.4483Soft Maple 3.4483Sycamore 3.4483White Oak 10.3448Willow 3.4483Yellow Birch 3.4483
#include <iostream>#include <stdio.h>#include <string.h>#include <string>#include <algorithm>#include <map>#include <queue>using namespace std;int main(){ char s[35]; int n=0; int i; map<string,int>q; while(gets(s)!=NULL) { q[s]++; n++; } map<string,int>::iterator it; for(it=q.begin();it!=q.end();it++) { cout<<it->first; printf(" %.4f\n",(it->second*100.0)/n); } return 0;}
- STL--B - Hardwood Species
- Hardwood Species(STL)
- 【STL】POJ 2418---Hardwood Species
- POJ 2418 Hardwood Species 【STL】
- poj 2418 Hardwood Species(使用STL map)
- Hardwood Species
- Hardwood Species
- Hardwood Species
- Hardwood Species
- Hardwood Species
- Hardwood Species
- Hardwood Species
- Hardwood Species
- Hardwood Species
- POJ 2418 Hardwood Species(STL中map的应用)
- POJ 2418 Hardwood Species(STL map or Trie tree)
- poj2418 Hardwood Species STL熟悉+二叉查找树
- poj2418——Hardwood Species(stl+map)
- eclipse快捷键
- 2014新生暑假个人排位赛06 -444. 爱好和平 (数组模拟邻接表+dfs)
- iOS:ARC相关知识,assign/copy/retain/strong/weak/readyonly/readwrite/nonatomic/atomic
- ViewPager 详解(一)---基本入门
- 布隆过滤器(Bloom Filter)
- STL--B - Hardwood Species
- ural 1008 Image Encoding bfs
- Codeforces Round #260 (Div. 2)A. Laptops
- 2054A==B?hdu
- HDU 1028 Ignatius and the Princess III
- uvaLive 6667 Longest Chain ( splay )
- ios中的字面量语法
- java
- ural 1005 Stone Pile 01背包或dfs