-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgentaxtable2_main.cpp
More file actions
43 lines (37 loc) · 983 Bytes
/
gentaxtable2_main.cpp
File metadata and controls
43 lines (37 loc) · 983 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
#include <iostream>
#include <string>
#include "StringFunctions.h"
using namespace std;
int get_num()
{
string x;
int to_return;
getline(cin,x);
to_return = stoi(x);
return to_return;
}
int main()
{
while(cin)
{
vector<int> lines_vec;
try
{
lines_vec.push_back(get_num());
lines_vec.push_back(get_num());
lines_vec.push_back(get_num());
lines_vec.push_back(get_num());
lines_vec.push_back(get_num());
lines_vec.push_back(get_num());
}
catch(std::invalid_argument e)
{
continue;
}
cout << " | " << lines_vec[0] << " <= x < " << lines_vec[1] << " | " << lines_vec[2] << " | " << lines_vec[3] << " | " << lines_vec[4] << " | " << lines_vec[5] << " | \n";
string temp;
getline(cin,temp);
getline(cin,temp);
}
return 0;
}