参考资料
代码
#include "stdafx.h"
#include <stdlib.h>
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
// insert code here...
int a = 1;
int b = 1;
cout << "a:" << endl;
cout << ++a << endl;//先加再取
cout << a << endl;//先加再取
cout << "b:" << endl;
cout << b++ << endl;//先取再加
cout << b << endl;//先取再加
//****三目运算****
char char_a;
cin >> char_a;
cout << (char_a=(char_a >= 'A'&& char_a <= 'Z') ? (char_a + 32):char_a)<<endl;//大写转化为小写
cout << ((char)((char_a >= 'A'&& char_a <= 'Z') ? (char_a + 32) : char_a)) << endl;
system("pause");
return 0;
}