#include <iostream>
#include <cstdlib>
#include <cstring>
#include <vector>
using namespace std;
class TheNumberGameDivTwo{
private:
public:
string find( int n ){
string n1 = "John";
string n2 = "Brus";
//cout << "Mahesh"<< n2 << n1;
int i,q;
q = 0;
int k = n;
i = n-1;
for ( i = 2 ; i < k ; ++i ){
if ( !(k % i) ){
q += k / i;
k = k % i;
}
}
if ( q % 2 )
return "John";
else
return "Brus";
}
};
int main(){
TheNumberGameDivTwo T;
cout << endl << T.find(6);
cout << endl << "End of Program " << endl;
system("PAUSE");
}
Error 1
error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
d:\my documents\visual studio 2012\c++\topcoder\topcoder\source1.cpp 34 1 TopCoder