forked from ociule/codeeval
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfollowing_integer.cpp
More file actions
43 lines (34 loc) · 804 Bytes
/
following_integer.cpp
File metadata and controls
43 lines (34 loc) · 804 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 <fstream>
#include <sstream>
std::vector<int> * getDigits(int n) {
}
int getNextLargest(int n) {
return n + 1;
}
int main(int argc, char *argv[])
{
std::ifstream file;
std::string lineBuffer;
if (argc < 2) {
std::cout << "Please add the name of the file to process." << std::endl;
exit(1);
}
file.open(argv[1], std::ifstream::in);
while (!file.eof())
{
getline(file, lineBuffer);
if (lineBuffer.length() == 0)
continue;
else
{
std::istringstream iss(lineBuffer);
int val;
iss >> val;
std::cout << val << " " << getNextLargest(val) << std::endl;
}
}
return 0;
}