如何在向量或数组中检查两个不同或相同的元素是否彼此相邻?

时间:2013-11-30 21:53:26

标签: c++ c numbers

我想知道如何在矢量中检查两个数字或元素是否彼此相邻。

这是我到目前为止编写的内容并尝试过:

// 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标题

0 个答案:

没有答案
相关问题