- 听众
- 收听
- 积分
- 821
- 主题
- 回帖
- 0
- 精华
注册时间2007-4-1
最后登录1970-1-1
该用户从未签到
|
本帖最后由 donle 于 2009-5-15 15:50 编辑
随手写的一个, WR的排名程序.
编程水平有限,可能会有某些小问题
运行后生成一个TXT文本,按每位选手拥有的WR的数量进行排名,并列举所有该选手的WR地图和时间(XJ上其实有,照顾一些E文不好的, 就自己写了一个,而且有每个选手的所有WR地图列表,这个XJ是没有的 ^ ^)
根据那个谁谁谁的提示,又重新写了一个,源程序依然保留额
1.
操作方法:
1.进入XJ官方WR下载页面:http://xtreme-jumps.eu/demos.php
2.复制里面从第一条WR开始的记录(直接按住鼠标左键不放,往下拖就行了,一直到最后一条记录为止)
注意:加入任何其他的东西都会使最后运行出错!!!
3.将复制的内容粘贴到名为"list.txt"的文本里,然后将"WR排名.exe"和"list.txt"放在同一个文件夹下,运行.
4.之后就会生成一个名为"wr_mem_sort.txt"的文本文件, 里面的内容就是最后的排名了
有了这个就可以随时知道目前WR的排名了,XJ的左上角都不是实施更新的
下载1:
http://www.namipan.com/d/WR%e6%8e%92%e5%90%8d%e7%a8%8b%e5%ba%8f.rar/35a6c62cf121928cbce65e4aaff014be8b0c293f18b20100
2.
操作方法:
1.进入下载页面:http://xtreme-jumps.eu/demos.txt
2.复制里面的所有内容(或者直接下载另存)
注意:加入任何其他的东西都会使最后运行出错!!!
3.将复制的内容粘贴到名为"demo.txt"的文本里(下载下来的直接跳过此步),然后将"WR排名.exe"和"demo.txt"放在同一个文件夹下,运行.
4.之后就会生成一个名为"wr_mem_sort.txt"的文本文件, 里面的内容就是最后的排名了
下载2:
http://www.namipan.com/d/WR%e6%8e%92%e5%90%8d%e7%a8%8b%e5%ba%8f.rar/446d961764e3e9c5338d54e4fd4bf95b80dc2ab5b18b0100
//////////////////////////////////////////////////////////////////////////////////////////
下面是给XXX和NEWBIE之类的人看的, 如果看到觉得头晕的请无视:
C++的源代码我发上来了,这个程序写起来不高深,不知谁能有点优化的算法,而且我没有用CreatFile 和 OpenFile,是用的文件流.耗时可能会(非明显的)变长
CODE1:
-
- #pragma warning(disable: 4786)
- #include <windows.h>
- #include <fstream>
- #include <string>
- #include <map>
- #include <vector>
- #include <iomanip>
- using namespace std;
- int WINAPI WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nShowCmd )
- {
- fstream fin("list.txt", ios::in);
- if(!fin)
- {
- MessageBox(NULL, "不能打开当前文档!", "提示", MB_OK);
- return 0;
- }
- fstream fout("wr_mem_sort.txt", ios:ut);
- map<string, int> mem_rec;
- map<string, vector< vector<string> > > mem_maps;
- string map_name, name, time, temp_down;
- double fps;
- vector<string> temp;
- while(fin.peek() != EOF)
- {
- temp.clear();
- fin >> map_name >> name;
- if(name == "He" || name == "Fact" || name == "Muwka")
- {
- string Trush1, Trush2;
- if(name == "He")
- name.append(" B TeMy");
- else if(name == "Fact")
- name.append(" Or Fiction");
- else
- name.append(" Ha CePBeP");
- fin >> Trush1 >> Trush2;
- }
- fin >> time >> fps >> temp_down;
- mem_rec[name]++;
- temp.push_back(map_name);
- temp.push_back(time);
- mem_maps[name].push_back(temp);
- }
- fin.close();
- multimap<int, string> rec_mem;
- for(map<string, int>::iterator it = mem_rec.begin(); it != mem_rec.end(); it++)
- {
- rec_mem.insert(pair<int ,string>(it->second, it->first));
- }
- int count = 1;
- for(multimap<int, string>::reverse_iterator pos = rec_mem.rbegin(); pos != rec_mem.rend(); pos++)
- {
- fout << "\n*******************第" << count++ << "名*******************" << endl << endl;
- fout << "WR总数: " << pos->first << '\t' << "ID: " << pos->second << endl;
- fout << "所有WR记录如下: " << endl;
- for(map<string, vector< vector<string> > >::iterator iter = mem_maps.begin(); iter != mem_maps.end(); iter++)
- {
- if(iter->first == pos->second)
- {
- for(vector< vector<string> >::size_type i = 0; i != iter->second.size(); i++)
- {
- fout.setf(ios::left);
- for(vector<string>::size_type j = 0; j != iter->second.size(); j++)
- fout << setw(30) << iter->second[j] << '\t';
- fout << endl;
- }
- }
- }
- }
- MessageBox(NULL, "创建成功!", "提示", MB_OK);
- return 0;
- }
复制代码
CODE2:
- #pragma warning(disable: 4786)
- #include <windows.h>
- #include <fstream>
- #include <string>
- #include <map>
- #include <vector>
- #include <iomanip>
- using namespace std;
- int WINAPI WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nShowCmd )
- {
- fstream fin("demo.txt", ios::in);
- if(!fin)
- {
- MessageBox(NULL, "不能打开当前文档!", "提示", MB_OK);
- return 0;
- }
- fstream fout("wr_mem_sort.txt", ios::out);
- map<string, int> mem_rec;
- map<string, vector< vector<string> > > mem_maps;
- string map_name, name, time;
- vector<string> temp;
- string XJ_Title;
- fin >> XJ_Title;
- while(fin.peek() != EOF)
- {
- temp.clear();
- fin >> map_name >> time >> name;
- if(name == " ")
- continue;
- if(name == "He" || name == "Fact" || name == "Muwka")
- {
- string Trush1, Trush2;
- if(name == "He")
- name.append(" B TeMy");
- else if(name == "Fact")
- name.append(" Or Fiction");
- else
- name.append(" Ha CePBeP");
- fin >> Trush1 >> Trush2;
- }
- mem_rec[name]++;
- temp.push_back(map_name);
- int ValTime = atoi(time.c_str());
- int minute = ValTime / 60, second = ValTime % 60;
- time.erase(time.begin(), time.end());
- char tempmin[3], tempsec[3];
- itoa(minute, tempmin, 10);
- itoa(second, tempsec, 10);
- if(minute < 10)
- time.append("0");
- time.append(tempmin);
- time.append("分");
- if(second < 10)
- time.append("0");
- time.append(tempsec);
- time.append("秒");
- temp.push_back(time);
- mem_maps[name].push_back(temp);
- }
- fin.close();
- multimap<int, string> rec_mem;
- for(map<string, int>::iterator it = mem_rec.begin(); it != mem_rec.end(); it++)
- {
- rec_mem.insert(pair<int ,string>(it->second, it->first));
- }
- int count = 1;
- fout << "================================================" << endl;
- fout << "\n\t 内容来自" << XJ_Title << endl << endl;
- fout << "================================================" << endl;
- for(multimap<int, string>::reverse_iterator pos = rec_mem.rbegin(); pos != rec_mem.rend(); pos++)
- {
- fout << "\n*******************第" << count++ << "名*******************" << endl << endl;
- fout << "WR总数: " << pos->first << '\t' << "ID: " << pos->second << endl;
- fout << "所有WR记录如下: " << endl;
- for(map<string, vector< vector<string> > >::iterator iter = mem_maps.begin(); iter != mem_maps.end(); iter++)
- {
- if(iter->first == pos->second)
- {
- for(vector< vector<string> >::size_type i = 0; i != iter->second.size(); i++)
- {
- fout.setf(ios::left);
- for(vector<string>::size_type j = 0; j != iter->second[i].size(); j++)
- fout << setw(30) << iter->second[i][j] << '\t';
- fout << endl;
- }
- }
- }
- }
- MessageBox(NULL, "创建成功!", "提示", MB_OK);
- return 0;
- }
复制代码 |
评分
-
查看全部评分
|