• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
wjshan0808

Learn from yesterday, Live for today, For a better tomorrow.
 ————wjshan0808

博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页
2013年9月19日
Write a program that prints its input one word per line.
摘要: #include #define State '\n' void main(){ int Juge=0;/*only one space*/ int c=0; while((c=getchar())!=EOF) { if(c==' '||c=='\t'||c=='\b') { if(Juge==1) { putchar(State); Juge=0; } } else ... 阅读全文
posted @ 2013-09-19 09:38 wjshan0808 阅读(461) 评论(0) 推荐(0)
2013年9月17日
Write a program to copy its input to its output, replacing each tab by \t, each backspace by \b, and each backslash by \\. This makes tabs and backspa
摘要: #include #define DBS '\\'void main(){ int c; while((c=getchar())!=EOF) { if(c=='\t') { putchar(DBS); putchar('t'); } else if(c==' ') { putchar(DBS); putchar('b'); } else if(c=='\\') { ... 阅读全文
posted @ 2013-09-17 18:57 wjshan0808 阅读(399) 评论(0) 推荐(0)
Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank.
摘要: #include void main(){ int c,c_BCN; while((c=getchar())!=EOF) { if(c!=' ') c_BCN=0; if(c==' ') ++c_BCN; if(c_BCN<=1) putchar(c); } printf("\n%d\n",c);}df ff f f fff d fg fggdf ff f f fff d fg fgg 阅读全文
posted @ 2013-09-17 17:21 wjshan0808 阅读(584) 评论(0) 推荐(0)
C program Language 'EOF' and 'getchar()'
摘要: #include void main(){ int c; c=getchar(); while(c!=EOF) { putchar(c); c=getchar(); }}getchar() returns a distinctive value when there is no more input, a value that cannot be confused with any real character. This value is calledEOF, for ``end of file''.Q: The ty... 阅读全文
posted @ 2013-09-17 15:20 wjshan0808 阅读(365) 评论(0) 推荐(0)
linux下 解释 终端命令 ls -al或者ls -li 输出的信息
摘要: $ ls -al drwxr-xr-x. 6 wjshan0808 wjshan0808 4096 Sep 11 21:51 .cache$ ls -liinode值 文件类型权限 连接计数 文件拥有者 文件群组 大小 修改日期 名称12976146 drwxr-xr-x. 2 wjshan0808 wjshan0808 4096 Sep 16 12:37 Desktop注:连接计数 - 2 = 本目录直接包含的子目录和文件的总和 阅读全文
posted @ 2013-09-17 00:49 wjshan0808 阅读(3910) 评论(0) 推荐(0)
Linux 文件类型 ,文件权限
摘要: 第一个字符段:文件类型。第二个组字符段又分为三段(每三个字符为一段不足用‘-’):文件属性。1. drwxrwxrwx 2. -rwxr-xr-x第一字符段: 第二字符组段依次为:- :普通文件 1.文件拥有者 2.文件所属的组群成员 3.其他用户d :目录 r:可读 w:可写 x:可执行l :链接b:块设备文件c:字符设备文件、p:管道文件s:套接文件 阅读全文
posted @ 2013-09-17 00:05 wjshan0808 阅读(200) 评论(0) 推荐(0)
2013年9月16日
CentOS 的数字命令级别
摘要: 1 user commands2 system calls3 library functions4 special files5 file formats6 games7 conventions and miscellany8 administration and privileged commands这些只能有root执行 阅读全文
posted @ 2013-09-16 23:12 wjshan0808 阅读(135) 评论(0) 推荐(0)
CentOS 的命令链接符“;”
摘要: ";" 用于在一行中输入多个命令,执行顺序=输入顺序。For instance:$ ls -a;cd Music 阅读全文
posted @ 2013-09-16 22:47 wjshan0808 阅读(1238) 评论(0) 推荐(0)
'printf' Function
摘要: printf is not part of the C language; there is no input or output defined in C itself.printf is just a useful function from the standard library of functions that are normally accessible to C programs.The behaviour of printf is defined in the ANSI standard,(美国国家标准协会 American National Standards Insti 阅读全文
posted @ 2013-09-16 13:42 wjshan0808 阅读(227) 评论(0) 推荐(0)
'%' For instance '%d'
摘要: with each % indicating where one of the other (second, third, ...) arguments is to be substituted, and in what form itis to be printed. For instance, %d specifies an integer argumentaugment each %dFor Instanceprintf("%3d'F%6d'C\n",Fahrenheit,Celsius);to print the first number of ea 阅读全文
posted @ 2013-09-16 13:31 wjshan0808 阅读(280) 评论(0) 推荐(0)
"Celsius=5/9*(Fahrenheit-32)" and "Celsius=5*(Fahrenheit-32)/9 "
摘要: The reason for multiplying by 5 and dividing by 9 instead of just multiplying by 5/9 is that in C, as in many otherlanguages, integer division truncates: any fractional part is discarded. Since 5 and 9 are integers. 5/9 would betruncated to zero and so all the Celsius temperatures would be reported 阅读全文
posted @ 2013-09-16 13:20 wjshan0808 阅读(368) 评论(0) 推荐(0)
Data types 'int' and 'float'
摘要: The type int means that the variables listed are integers; by contrast with float, which means floating point,i.e., numbers that may have a fractional part. The range of both int and float depends on the machine you areusing; 16-bits ints, which lie between -32768 and +32767, are common, as are 32-b 阅读全文
posted @ 2013-09-16 11:37 wjshan0808 阅读(208) 评论(0) 推荐(0)
escape sequence "\c"
摘要: #include int main(){ printf("Hello World !\c"); return 0;}[10:40:36@wjshan0808 ~/Documents/C Program]$ gcc printf.cprintf.c:4:9: warning: unknown escape sequence '\c'[10:41:52@wjshan0808 ~/Documents/C Program]$ g++ printf.cprintf.c: In function ‘int main()’:printf.c:4: warning: unk 阅读全文
posted @ 2013-09-16 10:46 wjshan0808 阅读(963) 评论(0) 推荐(0)
#include <stdio.h>
摘要: The first line of the C program#include tells the compiler to include information about the standard input/output library. 阅读全文
posted @ 2013-09-16 09:42 wjshan0808 阅读(367) 评论(0) 推荐(0)
2013年9月15日
控制shell终端提示符格式和颜色
摘要: 字体颜色值(ASCII)背景颜色值(ASCII)显示颜色3040黑色3141红色3242绿色3343黄色3444蓝色3545紫红色3646青蓝色3747白色符 号值特效取反0OFF1HighLight2半亮224UndeLine245Blink257反白278不可见注:若着色不对,哈哈,请认为我是色... 阅读全文
posted @ 2013-09-15 21:06 wjshan0808 阅读(619) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3