码迷,mamicode.com
首页 >  
搜索关键字:eof    ( 7139个结果
hdu 3172
http://acm.hdu.edu.cn/showproblem.php?pid=3172题意:输出每对朋友的关系网大小并查集的时候维护一个数组记录根节点的大小即可,水题,这题坑在T组数据这个也要读到EOF,开始莫名其妙wa...#include #include #include #includ...
分类:其他好文   时间:2014-11-27 00:10:19    阅读次数:295
把输入一次一个字符复制到输出
# include void main (){ int c; while ((c=getchar())!=EOF) putchar(c);//printf("hello world!\c");}EOF的是为-1# include void main (){ int c...
分类:其他好文   时间:2014-11-26 22:20:00    阅读次数:185
BAT返回字符在字符串中的首个位置及最后一个位置
rem@echooff SETLOCALENABLEDELAYEDEXPANSION setk=speed_dao_mmr_20141016_300008588738_2200125875 call:PosLastChar%k%_aa echo%aa% pause goto:eof rem:poscharstrtagRes :PosChar setSubStr= setF=0 setTmpVar=%1 set%3=-1 :pos_begin setSubStr=!TmpVar:~%F%,1! ifnotd..
分类:其他好文   时间:2014-11-26 19:17:24    阅读次数:243
简易功能计算器0.1版本(基于双栈)
Lisa           这个傲娇的计算器叫Lisa。 /********************************************************* Code writer : EOF Code file : stack.h Code date : 2014.11.26 Email : jasonleaster@gmail.com ...
分类:其他好文   时间:2014-11-26 18:54:48    阅读次数:221
getchar返回int类型
#include /*copy input to output; 2nd version*/main(){intc;c=getchar();while(c !=EOF){putchar(c);c=getchar();}} 直觉告诉我getchar返回值应该是char类型的,这个地方为什么不能用ch....
分类:其他好文   时间:2014-11-25 18:18:53    阅读次数:111
读取磁盘中的文件,并统计行数
int Read(void) { unsigned int rc,i,get;  FILE *fp; fp = fopen("E:\\name.txt","r");   /*以只读的方式打开*/ if(fp == NULL) { return -1; } rc = 0; i = 0; while((get = fgetc(fp))!=EOF)         /*从fp指...
分类:其他好文   时间:2014-11-23 23:17:05    阅读次数:272
所有奇数的乘积
#includeint main (){ #ifdef ONLINE_JUDGE #else freopen ("in.txt","r",stdin); #endif int n,i; while(scanf("%d",&n)!=EOF){ int a[n],s=1; for ...
分类:其他好文   时间:2014-11-23 23:01:45    阅读次数:171
比大小
#includeint main (){ #ifdef ONLINE_JUDGE #else freopen ("in.txt","r",stdin); #endif int n,m; int a[101]; while(scanf("%d",&n)!=EOF&&(na[k+1])...
分类:其他好文   时间:2014-11-23 22:52:28    阅读次数:245
HDU1395 2^x mod n = 1 暴力题
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1395可以用欧拉定理证明其存在性。欧拉定理是这样的:如果a和m互质且a 2 int main() 3 { 4 int n; 5 while (scanf("%d", &n) != EOF){ ...
分类:其他好文   时间:2014-11-21 20:27:16    阅读次数:198
11.20
getchar()函数的输入方式在程序中使用getchar()读取字符、程序遇到的输入会先被放到一个输入缓冲队列中,直到程序读到了\n或EOF,程序才将\n或EOF前读到的字符赋值给变量。赋值是一个字符一个字符进行的,而getchar()是一个一个字符读取的,当输入缓冲队列中还有字符,getchar...
分类:其他好文   时间:2014-11-21 13:55:31    阅读次数:128
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!