028.程序流程结构-选择结构-三目运算符
作者:互联网
#include <iostream> using namespace std; int main() { //三目运算符 //创建三个变量A B C //A和B比较,将变量大得赋值变量C int a = 10; int b = 20; int c = 0; c = (a > b ? a : b); cout << c << endl; (a > b ? a : b )= 100; cout <<"a="<< a << endl; cout <<"b="<< b << endl; system("pause"); return 0; }
标签:20,变量,int,程序流程,运算符,三目,cout 来源: https://www.cnblogs.com/ceovs/p/15225730.html