https://www.runoob.com/cplusplus/cpp-comma-operator.html
while(cin >> n, n) 等同为while(cin >> n&&n);
while(scanf(“%d”&n)!=-1) 等同为while(~scanf(“%d”&n))
例如: while(cin >> n,n<=0); // 过滤0和负数
https://www.runoob.com/cplusplus/cpp-comma-operator.html
while(cin >> n, n) 等同为while(cin >> n&&n);
while(scanf(“%d”&n)!=-1) 等同为while(~scanf(“%d”&n))
例如: while(cin >> n,n<=0); // 过滤0和负数