Deadb0y 发表于 2021-1-7 23:01:44

666666666666666666666666666666666666666

xsc1004194661 发表于 2021-1-7 23:04:42

1 因为计算机只认识 0 1
2 编译
3 忘了
4 可以
5 通过解释器
6 符号对应的字母
7 亲们成我人吃饭时发动进攻

粉红喵喵拳 发表于 2021-1-7 23:51:02

这我可太难了才7行

粉红喵喵拳 发表于 2021-1-7 23:58:03

粉红喵喵拳 发表于 2021-1-7 23:51
这我可太难了才7行

老师为啥我的才是7行?您在网页上的复制粘贴下来也是7行?

bestdh 发表于 2021-1-8 01:33:01

kankan

时光消逝 发表于 2021-1-8 07:59:27

小甲鱼最帅!!!!!

攸鱼 发表于 2021-1-8 09:43:56

斯人凯文 发表于 2021-1-8 10:16:59

感谢楼主无私奉献

Ryorito 发表于 2021-1-8 10:53:42

报错了7项呀。。

W打烊 发表于 2021-1-8 10:56:24

本帖最后由 W打烊 于 2021-1-8 11:06 编辑

0.计算机只能识别0和1.
1.机器语言
2.编译
3.编译型语言直接编译成机器语言,解释型语言先给解释器再翻译成机器语言
4.不能
5.有专门制定的解释器
6.查表,找到对应的字符
7.亲们趁敌人吃饭时发动进攻
C:\Users\Public\Pictures\Sample Pictures

molili 发表于 2021-1-8 11:22:21

回复

GKDGKD 发表于 2021-1-8 11:37:12

分不清楚1 l{:5_99:}

novialalala 发表于 2021-1-8 12:46:48

感谢楼主无私奉献

a13766971255 发表于 2021-1-8 13:00:19

1

a13766971255 发表于 2021-1-8 13:01:07

a13766971255 发表于 2021-1-8 13:00
1

为什么我显示我的lstat没有被定义呢

攸鱼 发表于 2021-1-8 13:55:28

这是我自己在Dev-c++上打出来的,然后出现这个F:\C\collect2.exe        ld returned 1 exit status,
挨着检查了没其他的问题
去网上也试试解决方法都没有用
请问这个应该怎么解决,谢谢{:10_266:}

#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)
                {
                          fprintf(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 _finddata_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 _finddata_t fa;
        long handle;
        char thePath;
       
        strcpy(thePath, path);
        if((handle = _findfirst(strcat(thePath,"/*"),&fa)) == -1L)
        {
                   fprintf(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);
                          finfAllCodes(thePath);
                          findALLDirs(thePath);
                        }
        }while (_findnext(handle, &fa) == 0);
       
        _findclose(handle);
}

int main()
{
      char path = ".";
      
      printf("计算中...\n");
      
      findAllCodes(path);
      findALLDirs(path);
      
      printf("目前你总共写了 %ld 行代码!\n\n", total);
      system("pause");
      
      return 0;
}

哈士奇~潘 发表于 2021-1-8 14:21:38

查看参考答案

陌翊倾城 发表于 2021-1-8 14:37:37

#include<stdio.h>

int main()
{
        printf("I love hello world!\n");
        return 0;
}

lengyuye 发表于 2021-1-8 14:52:07

xiexie

阿湛是小白 发表于 2021-1-8 15:28:22

S1E2:第一个程序 | 课后测试题及答案 [修改]
页: 992 993 994 995 996 997 998 999 1000 1001 [1002] 1003 1004 1005 1006 1007 1008 1009 1010 1011
查看完整版本: S1E2:第一个程序 | 课后测试题及答案