-
Notifications
You must be signed in to change notification settings - Fork 0
/
gentaxtable_main.cpp
49 lines (44 loc) · 1.25 KB
/
gentaxtable_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
40
41
42
43
44
45
46
47
48
49
#include <iostream>
#include <string>
#include "StringFunctions.h"
using namespace std;
int get_num()
{
string x;
int to_return;
getline(cin,x);
x = StringFunctions::replace(x,",","");
to_return = stoi(x);
return to_return;
}
int main()
{
while(cin)
{
vector<vector<int>> lines_vec{5};
for(int i=0; i<6; i++)
{
try
{
lines_vec[0].push_back(get_num());
lines_vec[1].push_back(get_num());
lines_vec[2].push_back(get_num());
lines_vec[3].push_back(get_num());
lines_vec[4].push_back(get_num());
}
catch(std::invalid_argument e)
{
goto skip;
}
string x;
getline(cin,x);
getline(cin,x);
if(x!="")
cout << "ERROR: " << x << endl;
}
for(int i=0; i<5; i++)
cout << " | " << lines_vec[i][0] << " <= x < " << lines_vec[i][1] << " | " << lines_vec[i][2] << " | " << lines_vec[i][3] << " | " << lines_vec[i][4] << " | " << lines_vec[i][5] << " | \n";
skip: ;
}
return 0;
}