c++程序—三目运算符
#include<iostream> using namespace std; #include<string> int main() { //三目运算符 int a = 10; int b = 20; int c = 0; c = (a > b ? a : b); cout << "c=" << c << endl; (a > b ? a : b) = 100; cout << "a=" << a << endl; cout << "b=" << b << endl; system("pause"); return 0; }