这题目比较简单,把思路搞清楚就可以啦。

#include <stdio.h>
#include <string.h>
char words[+][]; int init(){
int cnt=;
while(~scanf("%s",words[cnt])){
if(strcmp("#",words[cnt])==) return cnt;
cnt++;
}
}
int judge(char a[],char b[]){
int success;
int la=strlen(a);
int lb=strlen(b);
int i,j,k;
int cnt=;
if(la==lb){
for(i=;i<la;++i)
if(a[i]!=b[i])
cnt++;
if(cnt==) return ;
} if(la==lb+)
for(i=;i<la;++i){
success=;
for(j=,k=;j<la&&k<lb;){
if(j==i){
j++;continue;
}
if(a[j]!=b[k]){
success=;
}
j++;k++;
}
if(success==) return ;
}
if(la+==lb)
for(i=;i<lb;++i){
success=;
for(j=,k=;j<la&&k<lb;){
if(k==i){
k++;continue;
}
if(a[j]!=b[k]){
success=;
}
j++;k++;
}
if(success==) return ;
}
return ;
} void done(int cnt){
char tmp[];
int i;
int success;
while(~scanf("%s",tmp)){
if(strcmp(tmp,"#")==)
return;
success=;
for(i=;i<cnt;++i){
if(strcmp(words[i],tmp)==){
printf("%s is correct\n",tmp);
success=;
break;
}
}
if(success==)
continue;
printf("%s:",tmp);
for(i=;i<cnt;++i){
if( judge(words[i],tmp)==){
printf(" %s",words[i]);
}
}
printf("\n");
}
return ;
}
int main(){
done(init());
return ;
}

poj1035 Spell checker的更多相关文章

  1. POJ1035——Spell checker(字符串处理)

    Spell checker DescriptionYou, as a member of a development team for a new spell checking program, ar ...

  2. Spell checker

     Spell checker Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Subm ...

  3. poj 1035 Spell checker

    Spell checker Time Limit: 2000 MS Memory Limit: 65536 KB 64-bit integer IO format: %I64d , %I64u   J ...

  4. Spell checker(暴力)

    Spell checker Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 20188   Accepted: 7404 De ...

  5. poj 1035 Spell checker ( 字符串处理 )

    Spell checker Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 16675   Accepted: 6087 De ...

  6. [ACM] POJ 1035 Spell checker (单词查找,删除替换添加不论什么一个字母)

    Spell checker Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 18693   Accepted: 6844 De ...

  7. Spell checker POJ 1035 字符串

    Spell checker Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 25426   Accepted: 9300 De ...

  8. POJ 1035:Spell checker

    Spell checker Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 22574   Accepted: 8231 De ...

  9. Code Spell Checker & VSCode 单词拼写验证

    Code Spell Checker & VSCode 单词拼写验证 https://marketplace.visualstudio.com/items?itemName=streetsid ...

随机推荐

  1. EasyUI-draggable

    draggable用来在界面上创建一个可以拖动的元素,既然是可以拖动的元素,那么它在拖动过程中会有下面的几个事件:onBeforeDrag.onStartDrag.onDrag.onStopDrag. ...

  2. iCheck表单美化插件使用方法详解(含参数、事件等)

    iCheck   特色: 1.在不同浏览器(包括ie6+)和设备上都有相同的表现 - 包括 桌面和移动设备 2.支持触摸设备 - iOS.Android.BlackBerry.Windows Phon ...

  3. repo安装

    repo是使用python开发的一个用于多版本管理的工具,可以和git协作,简化git的多版本管理. repo安装: 1.新建~/bin,并将此目录包含在path变量中(如果已存在,且已在path变量 ...

  4. asterisk中eyebeam与移动的IMS帐号对接

    账号和密码: 05128068****       xbfldz6658****IP:120.195.9.148域名:ims.js.chinamobile.com    上图吧:

  5. QT中QWidget、QDialog QMainWindow

    继承关系:在Qt中所有的类都有一个共同的基类QObject ,QWidget直接继承与QPaintDevice类,QDialog.QMainWindow.QFrame直接继承QWidget 类. QW ...

  6. 如何在组件(Component中)模拟用户控件(UserControl)中FindForm()?

    using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentM ...

  7. isIsomorphic

    超时版: /* Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if t ...

  8. strstr、strcmp、strlen、strcpy

    const char* strstr(const char *str, const char* substr) { int i, j, temp; ; str[i] != '\0'; i++) { j ...

  9. Android--ListView显示列表数据

    简单的显示 import android.os.Bundle; import android.app.ListActivity; import android.view.View; import an ...

  10. Library Cache: Lock, Pin and Load Lock

    What is "Library cache lock" ? This event controls the concurrency between clients of the ...