#include<iostream>
using namespace std;
int main()
{
int m = 5;
if (m++ > 5)
{
cout << m << endl;
}
else
cout << --m;//5
system("pause");
}
//由此又即兴忆起金山的一道笔试题
#include<iostream>
using namespace std;
int main(int args,char **argv)
{
if (!(cout<<"hello "))//这是有些取巧的办法
{
cout << "hello ";
}
if (args == 0 || main(0, NULL))
{
cout << "hello ";
}
else
{
cout << "world" << endl;
system("pause");
}
return 0;
}
/*
1.第一次执行main方法是args=1.第二次调用main传入NULL,这样args==0,就是true。
2.利用||运算符,如果前面为true则不在计算后面的表达式,所以就控制了main方法
只调用一次。
*/