/*
Verify that the expression getchar() != EOF is 0 or 1.
*/
#include
main()
{
int c;
while(c = getchar() != EOF)
{
printf("%d\n", c);
}
printf("%d - at EOF\n", c);
}...
分类:
其他好文 时间:
2015-07-12 19:02:18
阅读次数:
145
#include
int a[100][100];
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
for(int i=1;i<=n;i++)
for(int j=1;j<=i;j++)
scanf("%d",&a[i][j]);
for(in...
分类:
其他好文 时间:
2015-07-12 15:44:22
阅读次数:
109
shell脚本利用Here Document ,打包C的源码并编译生成再执行。 shell携代攻击程序? cat 1.sh
#!/bin/bash
#
echo "正在产生 hello.c ... "
echo
cat <<‘EOF‘ > hello.c
#include<stdio.h>
int main()
{
printf(...
分类:
系统相关 时间:
2015-07-08 19:16:32
阅读次数:
191
常常遇到这段代码, while(scanf("%d",&num)!=EOF){...} ,对于 EOF 以及 scanf 函数的返回值始终没有好好研究过,本文将对这个问题进行一下简单的剖析。...
分类:
编程语言 时间:
2015-07-08 09:40:28
阅读次数:
152
#ctrl + l- 清屏 。 cLear#ctrl + c- 终止命令。#ctrl + d- 退出 shell,好像也可以表示EOF。#ctrl + z- 将当前进程置于后台,fg还原。#ctrl + r- 从命令历史中找 。 Reverse-i-search#ctrl + a- 光标移到行首 。...
分类:
其他好文 时间:
2015-07-07 16:13:40
阅读次数:
123
scanf家族除了scanf函数外,还有fscanf/sscanf,三者分别对应从标准输入/文件/字符串读取,对应的带不定参数版本分别为vscanf/vsscanf/vfscanf。这类函数有返回值,执行成功时返回值为读取成功的字段个数,失败时返回EOF。注意,返回0也算成功,只不过没有读取到有效匹...
分类:
其他好文 时间:
2015-07-06 17:36:15
阅读次数:
140
就是一个dp,数组内存的步数,
数组没清空,wa了一次
#include
#include
#include
using namespace std;
int step[110][110];
int main()
{
int N,P,M,T;
while(scanf("%d%d%d%d",&N,&P,&M,&T)!=EOF){
memset(step,0,siz...
分类:
其他好文 时间:
2015-07-03 22:06:23
阅读次数:
173
经常我们碰到这样一个C语言问题,例如:输入一个组整数,按照从小到大排序后输出结果输入: 1 7 9 2 4输出: 1 2 4 7 9这里要用C语言读入一段数的话,如果用int array[100];while(scanf("%d", &src) != EOF){ i++; array[i] = sr...
分类:
编程语言 时间:
2015-07-01 17:23:54
阅读次数:
186
# ctrl + l - 清屏 。 cLear
# ctrl + c - 终止命令。
# ctrl + d - 退出 shell,好像也可以表示EOF。
# ctrl + r - 从命令历史中找 。 Reverse-i-search
# ctrl + a - 光标移到行首 。 A
# ctrl + e - 光标移到行尾。 End
# ctrl + u - 清除光标到行首的字符 。U
# ctrl...
分类:
系统相关 时间:
2015-06-30 10:27:22
阅读次数:
220
1.创建一个脚本,能为其他脚本添加脚本信息:#vimcs.sh#!/bin/bashcat>$1<<EOF#!/bin/bash#Name:`basename$1`#Description:#Author:TEST#Version:0.0.1#Datatime:`date"+%F+%T"`#Usage:`basename$1`EOFvim+8$12.修改脚本,若打开的脚本中有内容,则直接打开,若为空则..
分类:
系统相关 时间:
2015-06-28 20:16:32
阅读次数:
200