zoukankan      html  css  js  c++  java
  • 获取总代码长度

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    
    #define  MaxLength 1000
    
    char Str[MaxLength];
    char File[MaxLength];
    
    int main()
    {
        int Cnt,Len,i,j;
        FILE *Fi;
        system("attrib *.c /s /d > file_list.txt");
        //system("attrib *.? /s /d >> file_list.txt");/*?代表需要添加的文件类型的后缀*/
        Cnt=0;
        freopen("file_list.txt","r",stdin);
        while(gets(Str)!=NULL)
        {
            Len=strlen(Str);
            for(i=0; i<Len; ++i)
            {
                if(Str[i]!='A'&&Str[i]!=' ')
                {
                    break;
                }
            }
            for(j=0; i<Len; ++i)
            {
                File[j++]=Str[i];
            }
            File[j++]='\0';
            Fi=fopen(File,"r");
            if(!Fi)
            {
                return -1;
            }
            while(!feof(Fi))
            {
                fgets(Str,MaxLength,Fi);
                Len=strlen(Str);
                if(Len>1)
                {
                    ++Cnt;
                }
            }
            fclose(Fi);
        }
        fclose(stdin);
        freopen("output.txt","w",stdout);
        printf("%d\n",Cnt);
        fclose(stdout);
        return 0;
    }
  • 相关阅读:
    PHP install perl module
    PHP 静态页
    PHP对类的操作
    PHP Mysql操作。
    2020.7.16
    2020.7.19
    2020.7.14
    2020.7.12
    2020.7.17
    2020.7.10
  • 原文地址:https://www.cnblogs.com/NoSoul/p/2511742.html
Copyright © 2011-2022 走看看