小弟有个问题不会,想请教一下
#include "stdafx.h"#include<iostream>
#include<iomanip>
using namespace std;
#define max(a,b) ((a)>(b)?(a):(b))
int _tmain(int argc, _TCHAR* argv[])
{
int m=0,n=0;
cout<<max(m,++n)<<endl;
return 0;
}
输出结果为什么是2,而不是1
2019-07-30 17:59
程序代码:#include <iostream>
using namespace std;
int main( void )
{
int m=0, n=0;
cout << ( m>++n ? m: ++n ) << endl;
}看到两个 ++n 了吗?
2019-07-31 08:29
2019-08-02 16:50