码迷,mamicode.com
首页 >  
搜索关键字:eof    ( 7139个结果
输入输出外挂
遇到卡时间比较死的题目的时候可以用 #include #include #include #include #include using namespace std; //适用于正负整形数 template inline bool scan_d(T &ret) { char c; int sgn; if (c = getchar(), c == EOF) return 0...
分类:其他好文   时间:2015-03-15 23:05:30    阅读次数:166
南阳田忌赛马
思路很巧妙的一道贪心题目,总体原则是赢不了你我就尽量拖你的好马下水。 题目地址:点击打开链接 #include #include #include using namespace std ; int tj[1005],king[1005] ; int n ; //马匹数目 int main() { while(scanf("%d",&n)!=EOF) ...
分类:其他好文   时间:2015-03-15 12:28:38    阅读次数:117
HDU 5186
#include using namespace std; int n, b, a[205]; char s[205]; int main() { while(scanf("%d%d", &n, &b) != EOF) { memset(a, 0, sizeof(a)); int MAX = 0; for(int i=0; i<...
分类:其他好文   时间:2015-03-15 12:28:17    阅读次数:182
C语言gets函数,fgets函数的使用
gets从标准输入设备读字符串函数。可以无限读取,不会判断上限,以回车结束读取。函数的具体功能如下所示:从stdin流中读取字符串,直至接受到换行符或EOF时停止,并将读取的结果存放在buffer指针所指向的字符数组中。换行符不作为读取串的内容,读取的换行符被转换为‘\0’空字符,并由此来结束字.....
分类:编程语言   时间:2015-03-15 10:45:31    阅读次数:365
字符串替换
字符串替换 时间限制:3000 ms  |  内存限制:65535 KB 难度:2 描述编写一个程序实现将字符串中的所有"you"替换成"we" 输入输入包含多行数据  每行数据是一个字符串,长度不超过1000  数据以EOF结束 输出对于输入的每一行,输出替换后的字符串 样例输入 you are what you do 样例输出 we a...
分类:其他好文   时间:2015-03-14 17:03:55    阅读次数:124
A+B
题目描述:Calculate a+bDescriptionTwo integer a,b (0int main(){inta,b;while(scanf("%d%d",&a,&b)!=EOF){printf("%d\n",a+b);}return 0;}
分类:其他好文   时间:2015-03-14 15:18:38    阅读次数:138
HDOJ1001 Sum Problom
HDOJ10001 Sum ProblemAccepted.代码如下:#includeint main(){ int n; while(scanf("%d",&n)!=EOF) { int i,sum = 0; for(i=1;i<=n;i++) ...
分类:其他好文   时间:2015-03-12 22:03:35    阅读次数:93
CQU_回文数
/* 分析: 10取余的方法,从最低位开始,依次取出该数的各位数字。 按反序重新构成新的数,比较与原数是否相等,若相等,则原数为回文。 */ # include bool syn(int n); int main(void) { long a,b; while(scanf("%d %d", &a, &b) != EOF) { getchar(); //吸收回车符。 in...
分类:其他好文   时间:2015-03-11 12:59:03    阅读次数:138
hdu 2019
Problem Description有n(nint main(){int n,m,i,j,temp,cnt;int str[101];while(scanf("%d%d",&n,&m)!=EOF){if(n==0 && m==0) return 0;else{for(i=0;i=m){cnt=i;...
分类:其他好文   时间:2015-03-11 10:31:23    阅读次数:93
hdu 2016
Problem Description输入n(nint main(){int n,i,temp,cnt,min;int str[100];while(scanf("%d",&n)!=EOF){if(n==0) return 0;else{for(i=1;i<=n;i++){scanf("%d",&s...
分类:其他好文   时间:2015-03-11 09:17:05    阅读次数:186
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!