如果x
等于y
,则打印“1”;如果x
大于y
,则打印“2”;否则打印“3”。
int x = 50; int y = 50; @(2) (x @(2) y) { cout << "1"; } @(7) (x @(1) y) { cout << "2"; } @(4) { cout << "3"; }
int x = 50; int y = 50; if (x == y) { cout << "1"; } else if (x > y) { cout << "2"; } else { cout << "3"; }