#include #include #include using namespace std;int main(){ // freopen("acm.acm","r",stdin); // freopen("out.acm","w",stdout); string s; ...
分类:
其他好文 时间:
2015-06-09 15:26:02
阅读次数:
127
#include#include#include#include#includeusing namespace std;string _m[100005];int main(){ //freopen("acm.acm","r",stdin); int num; int i; int j; int p...
分类:
其他好文 时间:
2015-06-09 13:14:15
阅读次数:
100
1.dup和dup2作用都是用来复制一个文件的描述符。它们常用来重定向进程的stdin、stdout和stderr。这两个函数的 原形如下:#include int dup( int oldfd ); int dup2( int oldfd, int targetfd )利用函数dup,我们可以复制...
分类:
其他好文 时间:
2015-06-08 21:21:03
阅读次数:
166
文件描述符是一个打开的文件或数据流相关联的证书0-------stdin 标准输入1-------stdout 标准输出2-------stderr 标准错误# echo “this is a file” > file.txt //将this is a file 重定向到文件file.txt中# e...
分类:
其他好文 时间:
2015-06-05 00:33:26
阅读次数:
123
解压mysql.tar.gz时出现下面的错误信息:gzip:stdin:notingzipformattar:Childreturnedstatus1tar:由于前面延迟的错误而退出原因是原来压缩时没有启用gzip(即参数z),所以解压缩时不需要用z参数tar-xvf****.tar.gz
分类:
其他好文 时间:
2015-06-04 06:21:55
阅读次数:
99
import reimport ioimport sysinput_stream = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')s = input_stream.readlines()s = "\n".join(s)pc = '(//.*...
分类:
其他好文 时间:
2015-06-03 08:25:20
阅读次数:
1717
题目链接:
HDU5236
代码:
#include
#include
#include
#include
#define MAXN 0x3f3f3f3f
using namespace std;
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
f...
分类:
其他好文 时间:
2015-06-02 13:29:39
阅读次数:
116
fgets(buf,sizeof(buf),stdin);从文件读取字符串到buf数组中isalpha一种函数:判断字符ch是否为英文字母,若为小写字母,返回2,若为大写字母,返回1。若不是字母,返回0。在标准c中相当于使用“isupper(ch)||islower(ch)”做测试,
分类:
其他好文 时间:
2015-06-02 10:55:27
阅读次数:
106
做MP3播放器时需要键盘控制音乐播放,比如按空格键音乐暂停/播放。网上查找了好久发现大都是stty命令修改终端+ioctl(STDIN_FIONREAD,&flag)读取缓冲区字符数。验证之后发现,其实用只用stty命令即可完成功能。示例如下:
分类:
其他好文 时间:
2015-06-01 20:40:06
阅读次数:
172
STDIN_FILENO与STDIN的区别:STDIN_FILENO:1).数据类型:int2).层次:系统级的API,是一个文件句柄,定义在<unistd.h>中。3).相应的函数:open(),close(),read(),write(),lseek()等系统级别的函数。SDTIN:1).数据类型:FILE*2).层次:c语言的提供的标准输入流。c语..
分类:
其他好文 时间:
2015-06-01 20:37:59
阅读次数:
173