{:5_100:}
0.不懂人话
1.二进制
2.编码
3.有无翻译器
4.能
5.
来,让我康康
答案
S1E2:第一个程序 | 课后测试题及答案
{:5_106:}
1
{:5_109:}
感谢大佬的教学
本帖最后由 小白2024.1.6 于 2024-1-6 14:26 编辑
(0),他只能读懂0和1的二进制语言2 (1),机器语言 (2),编译 (3),编译型语言只需要翻译一次而解释性语言需要执行一次解释一次 (4),可以(5),jajv把程序转化为字节码然后发送给解释器由解释器逐句翻译给CPU(6),将铭文对照编码表实现编码,将密文转换为原文为解码(7)亲们趁敌人吃饭时发动进攻
第零题:
因为他只懂二进制
第一题:
机器语言
第二题:
编译
第三题:
编译型语言:
C --> 汇编语言 --> 机器码
解析型语言:
Java --> 字节行 --> 解析器 --> 机器码
第四题:
大部分可以
第五题:
因为解释型语言是直接翻译为机器码的
第六题:
编码 解码
第七题:
亲门陈地人是发动进公
第八题:
计算中...
目前你总共写了109行代码!
请按任意键继续. . .
0,因为计算机很快,但是不聪明。只认识0和1
1,机械语言
2,编译
3,一个是机器的语言,一个是人的语言
4,是
5,
6用·和-来代替字母
7,qin,men
chen,d
i,ren,chi,fan
shi,fa,dong,jing,ong
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#define MAX 256
long total;
int countLines(const char *filename);
int isCode(const char* filename);
void findAllDirs(const char*path);
int count=0;
int temp;
int countLines(const char *filename)
{
FILE *fp;
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;
}
int isCode(const char *filename)
{
int length;
length = strlen(filename);
if (!strcmp(filename + (length -2), ".c"))
{
return 1;
}
else
{
return 0;
}
}
void findAllDirs(const char *path)
{
DIR *dp;
struct dirent *entry;
struct stat statbuf;
if ((dp = opendir(path)) == NULL)
{
fprintf(stderr,"The path %s is wrong!\n",path);
return;
}
chdir(path);
while ((entry=readdir(dp) ) !=NULL)
{
lstat(entry->d_name,&statbuf);
if(!strcmp(".",entry->d_name)||strcmp("..",entry->d_name))
continue;
if(S_ISDIR(statbuf.st_mode))
{
findAllDirs(entry->d_name);
}
else
{
if(isCode(entry->d_name))
{
total += countLines(entry->d_name);
}
}
}
chdir("..");
closedir(dp);
}
int main()
{
char path = ".";
printf("计算中。。.\n");
findAllDirs(path);
printf("目标你总共写了%ld 行的代码!\n\n",total);
return 0;
}
1
看看大家的
报错
0 只认识二进制
1 二进制
2 编译
4 可以
5 逐句翻译
6 编译性
{:10_277:}
111
做完了
@FishC,c语言怎么实现数组的元素删除