long checkwide (long wide)
{
	long counts = 0;
	if (wide == 1)
	{
		result[0]=2;
		result[1]=3;
		result[2]=5;
		result[3]=7;
		counts = 4;
		return counts;
	}
	long base = (wide+1) / 2;
	long begin = pow(10.0, base - 1);
	long end = pow(10.0, base);

	for(long i = begin; i < end; ++i)
	{
		long x = getReverse(i, wide % 2, (wide+1)/2);
		if (isPrime(x))
		{
			result[counts] = x;
			++counts;
		}
	}
	return counts;
}
Beispiel #2
0
void printInteger(int X){
  	int Y=getReverse(X);
  	while(Y>0)
	{
  	printChar(48+mod(Y,10));
  	Y=div(Y,10);
 	 }
}
bool JoystickMapper::getValue(string name, string& value)
{
    if (name == "inputDevice")
        value = inputDevice;
    else if (name == "deviceId")
        value = getString(deviceId);
    else if (name.substr(0, 4) == "axis")
        value = getMap(JOYSTICK_AXIS1 + getOEInt(name.substr(4)));
    else if (name.substr(0, 6) == "button")
        value = getMap(JOYSTICK_BUTTON1 + getOEInt(name.substr(6)));
    else if (name.substr(0, 15) == "sensitivityAxis")
        value = getSensitivity(JOYSTICK_AXIS1 + getOEInt(name.substr(15)));
    else if (name.substr(0, 11) == "reverseAxis")
        value = getReverse(JOYSTICK_AXIS1 + getOEInt(name.substr(11)));
    else if (name.substr(0, 3) == "map")
        value = inputDeviceMap[name.substr(3)];
    else
        return false;
    
    return true;
}
bool _NativeFrameworkDSString::isPalindrome(){
	if(equalsTo(getReverse())) return true;
	return false;
}
Beispiel #5
0
int main()
{
	bool isExist;
	int res = getReverse(5, 6, &isExist); 
	return 0;
}