programfoeme 发表于 2018-11-14 16:54:00

编程的莫名小错误

#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
using namespace std;
static int x=[](){std::ios::sync_with_stdio(false);cin.tie(0);return 0;}();

          class Solution
{
public:
        bool ispalindrome(string s)
        {
               if(s.empty()) return true;
               int s_size=s.size();
               int i=0;
               while(i<s_size)
                   {
                     if(!isalnum(s)){s_size__:continue; }
                     if(!isalnum(s)){i++;continue ; }
                     if(tolower(s)!=tolower(s)) return false;
                        }
                          return 0;
                }
        };
        int main()
        {
          string s="A man, a plan, a canal: panama";
          cout<<Solution().ispalindrome(s)<<endl;
          return 0;
        }
    代码附上

仰望天上的光 发表于 2018-11-14 20:25:20

VC6是1998年出的IDE。而C++11标准是2011年提出的,实现它的编译器理论上应当在2011年之后。
页: [1]
查看完整版本: 编程的莫名小错误