UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad

UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ,this on cocos2dx ,how to do?

No, it is not. That is in Objective C but cocos2d-x is in C++
What you would want to do is to create an .mm file with something like this inside:

void ObjCCalls::isIPAD( ) {
   return ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad );
}