我想知道如何在矢量中检查两个数字或元素是否彼此相邻。
这是我到目前为止编写的内容并尝试过:
// Check stack postfix, to see if operator needs to be pushed on
for (int it = 0; it < postfixstack.size(); it++)
{
int count = 0; // keeps track of how many numbers
// If number, continue, else....do something?
if (isdigit(it))
{
count++;
continue;
}
else
// do something if element is not a number
}
我很幸运使用了sstream标题