Pagini recente » Cod sursa (job #2180666) | Cod sursa (job #1373252) | Cod sursa (job #3177640) | Cod sursa (job #2679423) | Cod sursa (job #2364875)
#include <fstream>
#include <unistd.h>
#include <algorithm>
#include <string>
using namespace std;
ifstream in("adunare.in");
ofstream out("adunare.out");
string get_working_path()
{
char temp[5001];
return ( getcwd(temp, sizeof(temp)) ? string( temp ) : string("") );
}
bool startsWithCaseInsensitive(string mainStr, string toMatch)
{
// Convert mainStr to lower case
transform(mainStr.begin(), mainStr.end(), mainStr.begin(), ::tolower);
// Convert toMatch to lower case
transform(toMatch.begin(), toMatch.end(), toMatch.begin(), ::tolower);
if(mainStr.find(toMatch) == 0)
return true;
else
return false;
}
long long a, b;
int main()
{
in >> a >> b;
out << ((startsWithCaseInsensitive(get_working_path(), "/infoarena")) ? (a+b) : -1);
return 0;
}