-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
39 lines (39 loc) · 862 Bytes
/
main.cpp
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
#include "merge-1.cpp"
#include "merge-2.cpp"
#include "merge-3.cpp"
//链接器-命令行中添加"/FORCE:MULTIPLE "以忽略LNK2005报错
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
//输出"option.txt"内容
string cont;
int ch, line = 0;
FILE* option = fopen("config\\options.txt", "r");
do {
ch = fgetc(option);
if (ch == '\n') line++;
} while (ch != EOF);
rewind(option); //指针返回开头
char temp1[100];
string temp2="";
for (int i = 1; i <= line*2; i++) {
fgets(temp1, 101, option); //单行内容不超过100字
if (temp2 != temp1) { //去重
cout << temp1;
temp2 = temp1;
}
}
cout << "请输入:";
char input=getchar();
cout << endl;
if (input == '1') merge1();
if (input == '2') merge2();
if (input == '3') {
merge3();
merge1();
merge2();
}
system("pause");
return 0;
}