足球,点球大战要是5个点球都发进去了,那怎么办

如题所述

第1个回答  2010-07-02
平局
第2个回答  2010-07-02
加球 一球定胜负
第3个回答  2010-07-02
再继续
第4个回答  2020-02-11
#include #include #define MAX 1000int next[MAX];int s_len;char str[MAX], str_t[MAX]; void get_next(){ int i; next[0] = -1; for(i = 1; i < s_len; ++i){ int j = next[i-1]; while(str_t[i] != str_t[j+1] && j != -1) j = next[j]; if(str_t[i] == str_t[j+1]) next[i] = j + 1; else next[i] = -1; }} int kmp(char *str, char *str_t){ int i; int len = strlen(str); int j; int cnt = 0; s_len = strlen(str_t); get_next(); j = -1; for(i = 0; i < len; ++i){ if(str[i] != str_t[j+1] && j != -1) j = next[j]; if(str[i] == str_t[j+1]){ ++j; } if(j == s_len-1){ cnt++; j = next[j]; } } return cnt;} int main(){ scanf("%s %s

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网