-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
48 lines (46 loc) · 1.25 KB
/
test.cpp
File metadata and controls
48 lines (46 loc) · 1.25 KB
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
#include <iostream>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
int main(){
ifstream fin("config.cfg");
string line;
istringstream sin;
string ipName, iptask, congratulations;
int ti = 0;
int gen[] = {0, 0, 0};
while (getline(fin, line)) {
sin.str(line.substr(line.find("=")+1));
if (line.find("TYPE_I") != string::npos) {
sin >> ti;
cout << "num "<< ti << endl;
}
if(ti){
if (line.find("ELEM_COUNT") != string::npos) {
sin >> gen[0];
cout << gen[0] << endl;
}
else if (line.find("DZ_COUNT") != string::npos) {
sin >> gen[1];
cout << gen[2] << endl;
}
else if (line.find("SHIFT_COUNT") != string::npos) {
sin >> gen[2];
cout << gen[2] << endl;
}
}
else{
if (line.find("queue_manual") != string::npos) {
int i, j;
while(1){
sin >> i;
if(i == j) break;
cout << i << endl;
j = i;
}
}
}
}
}