Paste: 三目运算符

Author: hh
Mode: c++
Date: Wed, 13 Oct 2021 10:54:42
Plain Text |
const char x[2][20] = {"333 ","service\n"};
	const char * y = "Quilstone ";
	for (int i = 0; i < 3; i++)
	{
		cout << ((i < 2) ? !i ? x[i] : y : x[1]);
	}

New Annotation

Summary:
Author:
Mode:
Body: