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

#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. HTML5列表、块、布局

    一.列表 <ol>  无序列表  (每项前有.) <ul>  有序列表   (每项前有编号1,,2,3) <li>   列表项 <ul type=" ...

  2. Linux tar指令

    linux 下的命令真是太多了.最近在看<Linux Shell编程从初学到精通>一书.该书有468页,很可惜我并不是那种很有耐性一个例子一个例子地跟着做的人,最多在看到些不太清楚的地方会 ...

  3. 转载__直接拿来用!最火的Android开源项目(一)

    http://www.csdn.net/article/2013-05-03/2815127-Android-open-source-projects 已分类汇总到 https://github.co ...

  4. JAVA用户数据输入

    数据输入 首先需要导入扫描仪 然后声明扫描仪 输出输入提示 接收用户数据的数据 输出用户数据的数据 实例: import java.util.Scanner; //导入扫描仪 public class ...

  5. SQL Server 2008 建立分区表 脚本

    /*第一步:创建分区函数*/Create partition function Part_func_Bag(varchar(20)) as range right /*正式区间for values(N ...

  6. EL表达式介绍

    EL 全名为Expression Language EL 语法很简单,它最大的特点就是使用上很方便.接下来介绍EL主要的语法结构: ${sessionScope.user.sex} 所有EL都是以${ ...

  7. C++学习2

    命名空间(Namespace)主要为了避免命名冲突,其关键字为namespace 在多人代码整合过程中常用到: namespace Li{ //小李的变量声明 ; } namespace Han{ / ...

  8. [ActionScript&Flex] FlashBuilder编译条件之如何屏蔽调试代码

    下面讲一下在FlashBuilder中如何添加编译器参数使我们在发布的时候不编译调试代码: 首先设置编译参数 编译参数设置好后,代码我们可以这样写: public class ConditionalC ...

  9. [ActionScript 3.0] AS3 GUID(全局唯一标识符)

    package com.controls { import flash.display.Sprite; import flash.system.Capabilities; public class G ...

  10. 微信红包签名算法 C#代码实现

    string stringA = "appid=wxd930ea5d5a258f4f&body=test&device_info=1000&mch_id=100001 ...