zoukankan      html  css  js  c++  java
  • 在文本文档中查找数据的应用C语言+dos

     目的是搜索一个名称是否在文档中存在,存在的话显示出来。不是完全用C语言,结合一点批处理技术,实现起来比较简单

    #include<stdio.h>
    #include<stdlib.h>
    #include<windows.h>
    #include<conio.h>
    #include<string.h>
    int main()
    {
        char string_to_be_find[100];
        while(true)
        {
            char find[100]="find /I d:\\查找题目专用文档--随时更新--ma6174.txt \"";
            printf("\t\t题目查找专用程序   BY ma6174\n\n");
            printf("请输入要查找的题目名:");
            gets(string_to_be_find);
            if(strlen(string_to_be_find)==0)
            {
                system("cls");
                continue;
            }
            strcat(find,string_to_be_find);
            strcat(find,"\"");
            system(find);
            printf("是否将题目名加入文档?(y/n)");
            char choice=getche();
            if(choice=='y'||choice=='Y')
            {
                char write_in_file[100]="echo ";
                strcat(write_in_file,string_to_be_find);
                strcat(write_in_file," >>d:\\查找题目专用文档--随时更新--ma6174.txt");
                system(write_in_file);
                printf("\n\n题目名已经写入!");
                Sleep(2000);
            }
            system("cls");
        }

    }

  • 相关阅读:
    linux运维、架构之路-Kubernetes离线、二进制部署集群
    linux运维、架构之路-Kubernetes集群部署
    创建SpringMVC项目过程
    Spring AOP使用方式
    Java动态代理
    Java工厂模式解耦 —— 理解Spring IOC
    Neural Turing Machine
    小米路由器mini刷锐捷
    目前深度学习开源数据集整理
    Spring编译后没有xml配置文件解决方法
  • 原文地址:https://www.cnblogs.com/ma6174/p/2339245.html
Copyright © 2011-2022 走看看