Cod sursa(job #2364875)

Utilizator testtestDan Butuc testtest Data 4 martie 2019 11:14:01
Problema A+B Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.81 kb
#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;
}