此代码如何找到非正值?
#include <map>
#include <cstdio>
#define until(cond) while(!(cond))
using namespace std;
int main() {
// initialization
map<int,int> second;
int i=10;
int testme[10]={4,3,1,-3,7,-10,33,8,4,14};
while (i --> 0) second[i]=testme[i];
// find the first non-positive value in second
map<int,int>::reverse_iterator p = --second.rend();
do {
printf("Is %d non-positive?\n",second[++i]);
} until(-- p ---> second < 0);
// "second < 0" to check if the value in second is non-positive
printf("Yes it is!\n");
}
输出是:
Is 4 non-positive?
Is 3 non-positive?
Is 1 non-positive?
Is -3 non-positive?
Yes it is!
那么“second < 0”字符串如何检查非正值呢?