int match(char *str) ;
{ int len=strlen(str);
int hlen=(len+1)/2;
for(int i=0;i<hlen;i++) stack.push(str[i]);
int j=hlen-1;
while(!stack.empty() && j<len-1)
{
if(stack.pop()!=str[j]) break; j++;
}
if(!stack.empty() || j<len-1) return 1;
return 0;
}
import java.lang.reflect.Array;
import java.util.*;
public class Test12 {
public static void mai......
答案就在这里:为什么这里出错了?
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?
< 用半角西文
int match(char *str) //多了一个分号
{
int len=strlen(str);
int hlen=(len+1)/2;
for(int i=0;i<hlen;i++) stack.push(str[i]); //< 用半角西文
int j=hlen-1;
while(!stack.empty() && j<len-1) //< 用半角西文
{
if(stack.pop()!=str[j]) break; j++;
}
if(!stack.empty() || j<len-1) return 1; //< 用半角西文
return 0;
}