C语言菜鸟小白 发表于 2020-5-11 10:24:50

加油学好C语言,不挂科

神秘小帅哥 发表于 2020-5-11 11:06:42

0. 计算机语言是由0和1的编码组成只认识0和1
1.机器语言
2.编译
3.效率不一样
4.能
5.
6.加密跟解密

帅滴不要不要滴 发表于 2020-5-11 13:49:31

1

2450864878 发表于 2020-5-11 14:02:06

冲冲冲

JiaLess 发表于 2020-5-11 14:38:54

666

bitshs1216 发表于 2020-5-11 16:47:04

我我我

KK95666 发表于 2020-5-11 17:13:45

{:10_282:}

LWC660220 发表于 2020-5-11 17:42:44

115行

真的还没想好 发表于 2020-5-11 18:00:25

#include <io.h>
#include <direct.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX   256

long total;


int countLines(const char *filename);
void findAllCodes(const char *path);
void findALLFiles(const char *path);


int countLines(const char *filename)
{
    FILE *fp;
    int count = 0;
    int temp;

    if ((fp=fopen(filename,"r"))==NULL)
    {
      fprint(stderr,"Can not open the file:%s\n",filename);
      return 0;
    }

    while ((temp = fgetc(fp)) !=EOF)
    {
      if (temp=='\n')
      {
            count++;
      }

      fclose(fp);

      return count;
    }


    void findAllCodes(const char *path)
    {
      struct _finddate_t fa;
      long handle;
      char thePath,target;

      strcpy(thePath,path);
      if((handle=_findfirst(strcat(thePath,"/*.c"),&fa))!=-1L)
      {
            do
            {
                sprintf(target,"%s/%s",path,fa.name);
                total += countLines(target);
            }while (_findnext(handle,&fa)==0);
      }


      _findclose(handle);
    }

    void findALLDirs(const char *path)
    {
      struct _finddate_t fa;
      long handle;
      char thePath;

      strcpy(thePath,path);
      if((handle=_findfirst(strcat(thePath,"/*"),&fa))==-1L)
      {
            fprint(stderr,"The path %s is wrong!\n",path);
            return;
      }

      do
      {
            if (!strcmp(fa.name".")|| !strcmp(fa.name,".."))
                continue;

            if(fa.attrib == _A_SUBDIR)
            {
                sprintf(thePath,"%s/%s",path,fa.name);
                findAllCodes(thePath);
                findALLDirs(thePath);
            }
      }while (_findnext(handle,&fa)==0);

      _findclose(handle);

}

int main()
{
    char path=".";

    printf("计算中...\n");

    findAllCodes(path);
    findALLDirs(path);

    printf("目前你总共写了%1d行代码!\n\n",total);
    system("pause");

    return 0;
}






}

英国律师李好田 发表于 2020-5-11 18:00:43

x

水木年华2252 发表于 2020-5-11 18:09:57

答案

yong.li 发表于 2020-5-11 18:19:29

敲代码敲代码

KILAMUA 发表于 2020-5-11 18:40:52

11

闪闪红星挂心中 发表于 2020-5-11 18:47:58

{:10_277:}

风干柚子皮 发表于 2020-5-11 19:08:03

闪闪红星挂心中 发表于 2020-5-11 19:12:39

C:\Users\Administrator\Desktop
甲鱼,抄了一遍但出现了这个错误,不晓得是哪里原因

闪闪红星挂心中 发表于 2020-5-11 19:22:50

甲鱼,抄了两次不晓得这属于啥情况{:10_243:}

阳教授 发表于 2020-5-11 19:33:53

0. 为什么我们说计算机其实是“二傻子”?
因为计算机只能处理二进制数据
1. CPU 唯一认识的语言是什么语言?
机器语言
2. C 语言编写的源代码转换为汇编语言的过程叫什么?
编译
3. 编译型语言和解释型语言的本质区别是什么?
编译型语言是编译成机器语言,解释型语言要通过解析才能识别
4. 在 Linux 系统上用 C 语言编译的可执行程序,是否能在 Windows 系统上执行?
大部分可以运行
5. 解释型编程语言是如何实现跨平台的?
通过不同的解释器
6. 莫斯密码的原理其实是什么?

7. 视频中小甲鱼“故弄玄虚”的那段密文还原后是什么内容(中文)?R

初小雪 发表于 2020-5-11 20:24:47

1

1005439991 发表于 2020-5-11 21:47:22

file:///C:/Users/123/Desktop/109NG_G~1JS3%7BD2UG(DQ%7D9I.png
页: 691 692 693 694 695 696 697 698 699 700 [701] 702 703 704 705 706 707 708 709 710
查看完整版本: S1E2:第一个程序 | 课后测试题及答案