0.计算机只懂二进制的0和1
1.机器语言
2.编译
3.解释型语言需要跨平台,而编译型语言不需要
4.能
5.解释型编程语言→字节码→解释器→cpu执行
6.编译
Q 为什么我们说计算机其实是“二傻子”?
A 他只懂得二进制的0和1
Q CPU 唯一认识的语言是什么语言?
A 机器语言
Q C 语言编写的源代码转换为汇编语言的过程叫什么?
A 编译
Q 编译型语言和解释型语言的本质区别是什么?
A 编译型语言CPU可以直接执行,解释型语言需要通过解释器解释,才能让CPU执行
Q 在 Linux 系统上用 C 语言编译的可执行程序,是否能在 Windows 系统上执行?
A 能
Q 解释型编程语言是如何实现跨平台的?
A 通过解释器进行解释,再让CPU执行
Q 莫斯密码的原理其实是什么?
A 查表
Q 视频中小甲鱼“故弄玄虚”的那段密文还原后是什么内容(中文)?
A 亲们趁敌人吃饭时发动进攻(QINMENCHENDIRENCHIFANSHIFADONGJINGONG)
计算中...
目前你总共写了127行代码!
#include < io.h>
#include < direct.h>
#include < stdio.h>
#include < stdlib.h>
#include < string.h>
#define MAX 256
长总计;
int countLines(const char *文件名);
无效 findAllCodes(const char *path);
void findALLFiles(常量字符 *路径);
int countLines(常量字符 *文件名)
{
文件 *fp;
int 计数 = 0;
int 温度;
if ((fp = fopen(filename, “r”)) == NULL)
{
fprintf(stderr, “无法打开文件:%s\n”, filename);
返回 0;
}
而 ((temp = fgetc(fp)) != EOF)
{
如果 (temp == '\n')
{
计数++;
}
}
关闭(fp);
返回计数;
}
无效 findAllCodes(常量字符 *路径)
{
结构_finddata_t fa;
长柄;
char thePath, target;
strcpy(路径,路径);
if((handle = _findfirst(strcat(thePath, “/*.c”), &fa)) != -1L)
{
做
{
sprintf(target, “%s/%s”, 路径, fa.name);
总计 += countLines(target);
}while (_findnext(句柄, &fa) == 0);
}
_findclose(手柄);
}
无效 findALLDirs(常量字符 *路径)
{
结构_finddata_t fa;
长柄;
char thePath[最大];
strcpy(路径,路径);
if((handle = _findfirst(strcat(thePath, “/*”), &fa)) == -1L)
{
fprintf(stderr, “路径 %s 是错误的!\n”,path);
返回;
}
做
{
if (!strcmp(fa.name, “.”) || !strcmp(fa.name, “..”))
继续;
if( fa.attrib == _A_SUBDIR)
{
sprintf(thePath, “%s/%s”, 路径, fa.name);
findAllCodes(路径);
findALLDirs(路径);
}
}while (_findnext(句柄, &fa) == 0);
_findclose(手柄);
}
int main()
{
char 路径 = “.”;
printf(“计算中...\n”);
findAllCodes(路径);
findALLDirs(路径);
printf(“目前你总共写了 %ld 行代码!\n\n”, total);
system(“暂停”);
返回 0;
}
1
666
回复
继续来学习啦
aa
{:10_266:}
{:5_111:}
#include < io.h>
#include < direct.h>
#include < stdio.h>
#include < stdlib.h>
#include < string.h>
#define MAX 256
长总计;
int countLines(const char *文件名);
无效 findALLFiles(const char *path);
void findALLFiles(常量字符 *路径);
int countLines(常量字符 *文件名)
{
文件 *fg;
int 计数 = 0;
int 温度;
if ((fg = fopen (filename,"r"))==NULL)
{
fgrintf (stderr, "无法打开文件:%s\n",filename);
返回 0;
}
而((temp = fgetc (fg))! = EOF)
{
如果 (temp == '\n')
{
计数++;
}
}
关闭 (fg);
返回计数;
}
无效 findAllCodes (常量字符 *路径)
{
结构_finddata_t fa;
长柄;
char thePath, target;
strcpy(路径,路径);
if((handle = _findfirst (strcat (thePath, "/*.c") , &fa)) ! = -1L)
{
做
{
sprintf (target, "%s/%s", 路径, fa.name);
总计 += countLines (target);
}while (_findnext (句柄, &fa) == 0);
}
_findclose (手柄);
}
无效 dinddata_t fa;
{
结构_finddata_t fa;
长柄;
char thePath[最大];
stecpy (路径, 路径);
if ((handle = _findfirst (strcat (thePath, "/*") , &fa)) == -1L)
{
fprindf (stderr,"路径 %s 是错误的!\n",path);
返回;
}
做
{
if (! stecmp (fa.name, ".") || ! stecmp (fa.name, ".."))
继续;
if( fa.attrib == _A_SUBDIR)
{
speintf (thePath, "%s/%S", 路径, fa.name);
findAllCodes (路径);
findALLDirs (路径);
}
}while (_findnext (句柄, &fa) == 0);
_findclose(手柄);
}
int main ()
{
char 路径 = ".";
printf ("计算中...\n");
findALLCodes (路径);
findALLDirs (路径);
printf ("目前你总共写了 %1d 行代码!\n\n", total);
system("暂停");
返回 0;
}
为什么#include < io.h>会报错呢?
受教!
第一个程序
我敲完了!
111
{:10_257:}
file:///C:/Users/ziyuexia/Desktop/%E7%AC%AC%E4%B8%80%E6%AC%A1%E4%BD%9C%E4%B8%9A.png
为啥得到的结果不对