POJ2418
来源:互联网 发布:程序员该怎么建立博客 编辑:程序博客网 时间:2024/05/01 17:50
摘要:水,排序
#include <iostream>
#include <stdio.h>
#include <string>
#include <iomanip>
#include <algorithm>
using namespace std;
const int size = 1000000;
string input[size];
int main()
{
char tree[50];
int index = 0;
while(fgets(tree, 45, stdin)){
//string temp = tree;
//temp = temp.substr(0, temp.length()-1);
input[index++] = tree;
}
sort(input, input+index);
double total = index;
int pre_pos = 0;
for(int i=0; i<index; i++){
if(input[i] != input[pre_pos]){
printf("%s %.4f/n", input[pre_pos].substr(0, input[pre_pos].length()-1).c_str(), 100 * (i-pre_pos)/total);
pre_pos = i;
}
}
printf("%s %.4f/n", input[pre_pos].substr(0, input[pre_pos].length()-1).c_str(), 100 * (index-pre_pos)/total);
return 0;
}
- POJ2418
- poj2418
- poj2418
- poj2418
- poj2418
- poj2418
- poj2418 二叉排序树
- poj2418(水题,qsort)
- [poj2418]Hardwood Species
- poj2418 - Hardwood Species
- poj2418二叉查找树
- POJ2418 二叉查找树
- POJ2418解题方案
- POJ2418-Hardwood Species
- poj2418 字典树裸题
- poj2418~Hardwood Species~二叉排序树
- POJ2418--Hardwood Species【map】
- POJ2418--- Hardwood Species
- POJ2388
- 编导是做什么的?编导具体做什么
- 浅谈SUN JVM内存管理与应用服务器的优化 之SUN JVM内存管理
- 利用InstallShield12制作安装包之三:判断操作系统类型的多种方法
- VC++中什么是BSTR、LPSTR以及LPWSTR呢
- POJ2418
- Eclipse3.2.2中安装Spring IDE2.0.1
- POJ2632
- db_cache_size、shared_pool_size一些初始化参数为什么是0?
- 2440PWMTimer启动流程
- 明朝时代
- Word效率工具(WET)
- 日本产业研究--读后感二 关于原材料和组装加工业 从钢铁到切割钢铁的。嘿嘿
- 经常下载的朋友注意了,教你怎样硬盘零伤害!