国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 開(kāi)發(fā)設(shè)計(jì) > 正文

poj 1035 Spell checker

2019-11-11 06:58:57
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

字符串匹配,暴力可過(guò)

#include <cstring>#include <cstdio>char dic[10010][17];int wlen[10010];char Word[17];int dcnt;bool change(int index){ int len = strlen(word); int cnt = 0; for(int i = 0; i < len; ++i) { if(word[i] != dic[index][i]) ++cnt; if(cnt > 1) return false; } return true;}bool del(int index){ int len = strlen(word); int cnt,m; for(int i = 0; i < len; ++i) { cnt = m = 0; for(int j = 0; j < len; ++j) { if(j == i) continue; if(word[j] != dic[index][m++]) ++cnt; if(cnt) break; } if(!cnt) return true; } return false;}bool add(int index){ int len = strlen(dic[index]); int cnt,m; for(int i = 0; i < len; ++i) { cnt = m = 0; for(int j = 0; j < len; ++j) { if(i == j) continue; if(dic[index][j] != word[m++]) ++cnt; if(cnt) break; } if(!cnt) return true; } return false;}void check(){ int len = strlen(word); for(int i = 0; i < dcnt; ++i) if(len == wlen[i]) if(strcmp(dic[i],word) == 0) {
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 盐山县| 新疆| 措美县| 德江县| 洪湖市| 常德市| 江门市| 温州市| 枝江市| 玉田县| 宿松县| 琼中| 阜平县| 通河县| 翼城县| 常德市| 桐城市| 中西区| 镇坪县| 广宁县| 九江市| 新闻| 石柱| 周口市| 桐梓县| 嘉兴市| 五峰| 始兴县| 通州区| 江门市| 德江县| 万盛区| 咸阳市| 乌恰县| 承德市| 霸州市| 甘德县| 高平市| 阿图什市| 麻栗坡县| 民县|