X.er86

导航

2012年12月1日 #

POJ_1003~1005 普通简单题

摘要: 1003:Hangover原题链接:http://poj.org/problem?id=1003 1 #include<iostream> 2 #include<cstdio> 3 4 using namespace std; 5 6 int main() 7 { 8 double c; 9 while (cin >> c && c != 0)10 {11 double total = 0; // 计算突出的长度12 int n;13 for (n = 1; ; n++)14 ... 阅读全文

posted @ 2012-12-01 18:25 X.er86 阅读(46) 评论(0) 推荐(0)

POJ_1002:487-3279

摘要: 原题链接:http://poj.org/problem?id=1002分类:字符串处理与哈希映射算法:将字符串先转换为整数,将整数作为数组下标进行出现次数的统计,count数组开始初始化为0,统计整数的出现次数。c++源代码: 1 #include<iostream> 2 #include<string> 3 #include<cmath> 4 5 using namespace std; 6 7 long n; 8 long count[10000000] = {0}; 9 10 long change_s(string);11 string change 阅读全文

posted @ 2012-12-01 16:25 X.er86 阅读(136) 评论(0) 推荐(0)