发一个中文C语言编程,供学习交流,为祖国做贡献
Tofloor
poster avatar
a2894408693
deepin
2020-09-23 15:47
Author
花了一晚上复习C语言,顺便定义一下中文,使用中文翻译后发现整个世界都不同了,以前使用英文学习发现很多意思都是理解错误的.



C语言中文定义头文件代码:

#include
#include

/*
常用字符串转义符
\n 回车, 光标移至下一行行首
\r 回车, 光标移至本行行首
\t 水平制表符
\0 字符串结束符
\a 蜂鸣声
常用格式化转义符
%d 格式化整数
%u 格式化无符号整数
%x 格式化无符号十六进制整数
%f 格式化浮点数
%c 格式化字符
%s 格式化字符串
文件打开模式
"r"或"rb" 打开文件读取, 若不存在返回0
"w"或"wb" 打开文件写入, 若不存在创建, 失败返回0
*/

#define 主体 main
#define 返回 return
#define 打印格式(格式字符, ...) printf(格式字符, __VA_ARGS__)
#define 获取特征 getchar
#define 壹整 char
#define 贰整 wchar_t
#define 肆整 int
#define 肆浮 float
#define 空白 void
#define 自动 auto
#define 文件 FILE
#define 格式大小 sizeof
#define 真 true
#define 假 false
#define 零 0
#define 恒定 const
#define 如果 if
#define 否则 else
#define 做 do
#define 当 while
#define 为了 for
#define 继续 continue
#define 闸 switch
#define 实例 case
#define 默认 default
#define 打破 break
#define 结构 struct
#define 分配(数目, 格式) (格式*)malloc(数目*sizeof(格式))
#define 分配清空(数目, 格式) (格式*)calloc(数目, sizeof(格式))
#define 释放(内存) free(内存)
#define 文件打开(流, 文件名, 模式) fopen_s(流, 文件名, 模式)
#define 文件关闭(流) 流 = (FILE*)(流 ? fclose(流) : 0)
#define 文件打印格式(流, 格式字符, ...) fprintf(流, 格式字符, __VA_ARGS__)
#define 文件扫描格式(流, 格式字符, ...) fscanf_s(流, 格式字符, __VA_ARGS__)
#define 文件写入(流, 格式, 内存, 数目) fwrite(内存, sizeof(格式), 数目, 流)
#define 文件读取(流, 格式, 内存, 数目) fread(内存, sizeof(格式), 数目, 流)


源文件代码:

#include "C语言中文定义.h"

肆整 主体()
{
    壹整 *你好 = "你好吗";
    打印格式("%s", 你好);
    获取特征();
    返回 0;
}



Reply Favorite View the author
All Replies
1 / 3
To page
lbygljq
deepin
2020-09-23 17:02
#1
0 零还定义了
Reply View the author
Eric Zha
deepin
2020-09-23 17:26
#2
if用英文敲两下就行了,“如果”要敲5下
Reply View the author
ghostry
deepin
2020-09-23 17:53
#3
https://bbs.deepin.org/post/202705
if用英文敲两下就行了,“如果”要敲5下

这确实是,用中文编程,增加了击键次数
Reply View the author
wanzhendema
deepin
2020-09-23 18:09
#4
https://bbs.deepin.org/post/202705
if用英文敲两下就行了,“如果”要敲5下

把“如果”改为“苟”,否则改为“否”,if else 击键数就一样了。
Reply View the author
Comments
wtz
2020-09-24 04:41
且慢,先苟住XD
xiaonao880516
deepin
2020-09-23 18:25
#5
这怎么跟我写cucumber的feature文件似的
Reply View the author
luzhishen
deepin
2020-09-23 19:18
#6
回车 Return
换行 New line
Reply View the author
139******07
deepin
2020-09-23 21:24
#7
何必啊。。。。。。。。。。。。。
Reply View the author
lflflf
deepin
2020-09-23 21:43
#8
是的,看来中文编程,难的是中文
Reply View the author
o0******00@163.com
deepin
2020-09-23 21:55
#9
我有个更好的想法就是 :这些函数全部快捷键  例如 如果   否则      shift+rg      否则就是shift+fz    ,逻辑调用用shift+++.  定向用ctrl+++...等等。其实这些方面不是重点。精髓是实现某项功能的算法,算法优化。
Reply View the author
xmu714
deepin
2020-09-23 23:22
#10
这都是知乎上的老段子了,瞎折腾宏命令
Reply View the author
hdmi
deepin
2020-09-23 23:57
#11
https://bbs.deepin.org/post/202705
if用英文敲两下就行了,“如果”要敲5下

若   如  
Reply View the author
hdmi
deepin
2020-09-23 23:58
#12
https://bbs.deepin.org/post/202705
if用英文敲两下就行了,“如果”要敲5下

若   如  
Reply View the author
ltree
deepin
2020-09-24 00:51
#13
https://bbs.deepin.org/post/202705
if用英文敲两下就行了,“如果”要敲5下

若 也只要两下 R 、2。
Reply View the author
ltree
deepin
2020-09-24 00:59
#14
中文 主要是在面向对象的时候,能更好的帮助国人开发者理解,而且在一些比较复杂的关键字的时候,中文能用更少的字节来表达关键字,当然首先得会点文言文,若中文编程真成了,文言文将复兴,为中华民族伟大复兴添砖加瓦。
Reply View the author
ltree
deepin
2020-09-24 01:02
#15
https://bbs.deepin.org/post/202705
若 也只要两下 R 、2。

多输几次就只要一次了2333
Reply View the author
roy_lz
deepin
2020-09-24 01:11
#16
本帖最后由 roy_lz 于 2020-9-23 17:13 编辑

中文输入其实比英文更好,对于CPU来说,都是转为0101,不过中文需要更多的内存。
Reply View the author
zerofancy
deepin
2020-09-24 02:40
#17
什么乱七八糟的

Reply View the author
六七八九十
deepin
2020-09-24 02:53
#18
roy_lz 发表于 2020-9-23 17:11
中文输入其实比英文更好,对于CPU来说,都是转为0101,不过中文需要更多的内存。 ...

既然都是转为0101为何中文就需要更多内存
Reply View the author
六七八九十
deepin
2020-09-24 02:56
#19
中文编程不流行就是因为系统api都是英文,中文调用英文api有点四不像,假设有一个系统天然支持中文 api也是中文 用中问文编程理所当然文
Reply View the author
lcw0268
deepin
2020-09-24 03:22
#20
楼主发的图片丢了你的脸。
看楼主的主题帖子,。。。。。。
标题那么动听,内容呢?能供学习吗?
还到交流区发帖。
我晕。
截图软件也是Windows的吧?
Reply View the author
1 / 3
To page