码迷,mamicode.com
首页 >  
搜索关键字:eof    ( 7139个结果
一些简单的C
#include<stdio.h>intmain(){ intch=0;intflag=1; intline=1; while(EOF!=(ch=getchar())){if(flag) { printf("%d",line); flag=0; }putchar(ch);if(ch==‘\n‘) { flag=1; line++; } }return0;}
分类:其他好文   时间:2015-07-20 17:00:26    阅读次数:100
POJ 2533
题意:求最长递增子序列的长度,裸题。 思路:DP即可。 AC代码: #include #include #include using namespace std; #define maxx 1005 int main() { int n,v[maxx]; int dp[maxx]; while(scanf("%d",&n) != EOF) { for(int i = 1;...
分类:其他好文   时间:2015-07-20 12:58:45    阅读次数:103
HDOJ_1001
#includeint main(void){unsigned n;while(scanf("%d", &n) != EOF){printf("%d\n\n", (1+n)*n/2);}return 0;}n+1可能出现溢出情况,所以需要将n的数据类型改为unsigned
分类:其他好文   时间:2015-07-20 12:48:01    阅读次数:107
数据结构公共代码
#include//字符串函数头文件 #include//字符函数头文件 #include//malloc等 #include//标准输入输出头文件,包括EOF(=^Z或F6),NULL等 #include//atoi(),exit() #include//eof() #include<mat...
分类:其他好文   时间:2015-07-19 18:04:26    阅读次数:125
周题:UVa10736题。Foreign Exchange
题目大意:有n(1 2 #include 3 #include 4 using namespace std; 5 6 int a[500000],b[500000]; 7 int main() 8 { 9 int n,i;10 while(scanf("%d",&n)!=EOF &...
分类:其他好文   时间:2015-07-19 17:46:23    阅读次数:91
NYOJ 113 字符串替换(C++STL解法)
字符串替换 时间限制:3000 ms  |            内存限制:65535 KB 难度:2 描述 编写一个程序实现将字符串中的所有"you"替换成"we" 输入输入包含多行数据 每行数据是一个字符串,长度不超过1000 数据以EOF结束输出对于输入的每一行,输出替换后的字符串样例输入 you are what you do 样例输出 we are ...
分类:编程语言   时间:2015-07-19 15:04:30    阅读次数:155
HDU 5273 区间DP
输入一组数,m次询问 问每个询问区间的逆序数有多少 区间DP简单题 #include "stdio.h" #include "string.h" int dp[1010][1010],a[1010]; int main() { int n,m,i,j,k; while (scanf("%d%d",&n,&m)!=EOF) { for (i=1...
分类:其他好文   时间:2015-07-19 15:04:22    阅读次数:97
阿牛的EOF牛肉串
#include using namespace std;long long s0,s1,s2,s3;int main(){ int i,n; while(cin>>n) { s0=3;s1=1; s2=1;s3=1; for(i=2;i<=n;i++) { s2=s1*...
分类:其他好文   时间:2015-07-19 11:31:11    阅读次数:113
HDU 1159 && POJ 1458
最长公共子序列,状态转移方程见代码。 #include #include #include using namespace std; char s1[1005],s2[1005]; int dp[1005][1005]; int main() { while(scanf("%s",s1+1)!=EOF) { scanf("%s",s2+1); memset(dp...
分类:其他好文   时间:2015-07-18 11:04:26    阅读次数:123
HDU 1176
题意:中文题,不多说了。 思路:简单动态规划,类似于数塔,自底向上计算即可。 AC代码: #include #include #include #include using namespace std; int n,t,x; int dp[100005][12],maxt; int main() { while(scanf("%d",&n)!=EOF&&n) { mems...
分类:其他好文   时间:2015-07-17 22:50:15    阅读次数:145
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!