-1
int main(){
int x;
cout<<"enter a number: ";
cin>>x;
cout<<endl;
odd(x);
return 0;
}
void odd(int a){
if(a%2 != 0){
cout<<"the number is odd : "<< '(' +a+ ')';
}else{
even(a);
}
}
我执行上述计划,我得到不同的输出:为什么我在C++中获得不同的输出?
enter a number: 15
the number is odd : 96
这究竟是为什么?
感谢
C++没有字符串连接,它*绝对*不像其他语言那样具有数字到字符串的转换。 @ MikolajMularczyk的回答是正确的。 – Qix 2014-10-10 19:55:44