首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

openjudge邮箱验证,求找错!不知道为啥wrong answer解决方法

2012-05-22 
openjudge邮箱验证,求找错!不知道为啥wrong answer#include iostream#include cstringusing namespace

openjudge邮箱验证,求找错!不知道为啥wrong answer
#include <iostream>
#include <cstring>
using namespace std;
int lx(string str1,int p){
  int k;
  for(k=0;k<p;k++){
  if(str1[k]=='/0') return 1;
  }
  }
int main()
{ string str;
  int i,j,n,m,s,count;
  while(getline(cin,str)){
  count=0;
  s=0;
  n=str.length();
  if(str[0]=='@'||str[0]=='.'||str[n-1]=='@'||str[n-1]=='.') cout<<"NO"<<endl;
  else{
  if(lx) {cout<<"NO"<<endl;}
  else{
  for(i=0;i<n;i++){if(str[i]=='@') {count=count+1; m=i;}}
  if(count==1){
  for(j=m;j<n;j++){if(str[j]=='.') s=s+1;}
  if(s>=1&&str[m+1]!='.') cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
  }
  else cout<<"NO"<<endl;}
  }
  }
  return 0;
}


[解决办法]
if(lx) {cout<<"NO"<<endl;}什么意思???

热点排行