-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.cpp
More file actions
57 lines (51 loc) · 874 Bytes
/
template.cpp
File metadata and controls
57 lines (51 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
using namespace std;
string fname = ;
const int fnum = 10;
ifstream fin;
ofstream fout;
void init()
{
}
void load()
{
}
void work()
{
}
string modify(string iname, int id)
{
const int BUFSIZE = 20;
int buf[BUFSIZE] = {0};
int bsize = 0;
if (0 == id)
return iname+'0';
while (id)
{
buf[++bsize] = id%10;
id /= 10;
}
for (int i = bsize; i; --i)
iname += char('0'+buf[i]);
return iname;
}
int main()
{
for (int i = 0; i <= fnum; ++i)
{
string cur_name = modify(fname,i);
fin.open((cur_name+".in").c_str());
fout.open((cur_name+".ans").c_str());
init();
load();
work();
fin.close();
fout.close();
}
return 0;
}