This sounds a lot like help with an assignment, but I am going to give you the benefit of the doubt on that one.
I don't think you should try the Java to C++ converter you're using as that seems to create C++.NET code which I'm guessing you don't want.
I think something like this might solve your problem;
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
string to_string(const int& value)
{
ostringstream ss;
ss << value;
return ss.str();
}
int to_int(const string& value)
{
int i;
istringstream ss(value);
ss >> i;
return i;
}
int main(int argc, char* argv[])
{
fstream file("C:\\Temp\\input.txt");
int number_of_testcases;
file >> number_of_testcases;
ostringstream result;
for(int i = 0; i < number_of_testcases; ++i)
{
result << "Test case: " << (i + 1) << endl;
int number;
file >> number;
ostringstream test_case_result;
int matches = 0;
for (int first = 10; first < number; ++first)
{
string second_string = to_string(first);
for(int j = 0; j < second_string.size(); ++j) {
const string removed_digit = second_string.substr(0, j) + second_string.substr(j + 1, second_string.size() - j);
const int second = to_int(removed_digit);
if (first + second == number)
{
++matches;
test_case_result << first << " + " << second << " = " << number << endl;
}
}
}
result << matches << " match" << (matches == 0 ? "" : "es") << ": " << endl;
result << test_case_result.str();
}
cout << result.str() << endl;
return 0;
}
Hope this helps,
Fredrik