摘要: #include #include using namespace std;int main(){ double a,b,c,d,e,f,t; while(cin>>t){ if(t==0) break; else { while(t--) ... 阅读全文
posted @ 2014-12-17 11:34 __夜风 阅读(127) 评论(0) 推荐(0) 编辑
摘要: #include int main(){ int a,b; while(scanf("%d%d",&a,&b)!=EOF) { if((a+b)%86==0) puts("yes"); else puts(... 阅读全文
posted @ 2014-12-17 11:33 __夜风 阅读(79) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;int main(){ int a,i,b,t,k; while(cin>>a>>b,a,b){ t=a*100; k=0; for(i=0;i#includeusing namespace std;int m... 阅读全文
posted @ 2014-12-17 11:32 __夜风 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;void main(){ int t,s,n,m,k; int qhs(int); cin>>k; while(cin>>n,cin>>m,k--){ t=qhs(n); //s=qhs(... 阅读全文
posted @ 2014-12-17 11:30 __夜风 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include #include using namespace std;struct p{ int endd,start;};p p1[1000];bool cmp(p p1,p p2){ return p1.endd>t&&t) { for... 阅读全文
posted @ 2014-12-17 11:30 __夜风 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #includeusing namespace std;int main(){ float n,m,x,y,x1,y1,x2,y2; while(cin>>n,n){ double sum=0.0; cin>>x>>y; x1=x,y1=y... 阅读全文
posted @ 2014-12-17 11:29 __夜风 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include using namespace std;int main(){ int i,j,n,k,a[100],b[100]; cin>>n; while(n--) { memset(a,0,sizeof(a)); m... 阅读全文
posted @ 2014-12-17 11:28 __夜风 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include int main(){ int a[31][31]; int i,j,n; a[1][1]=a[2][1]=a[2][2]=1; for(i=3;i<=30;i++) { ... 阅读全文
posted @ 2014-12-17 11:27 __夜风 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #includeusing namespace std;int main(){ int i,j,b[1000],k; while(cin>>i>>j) { int a=0; if(i=0;k--) if(b[k]>9) ... 阅读全文
posted @ 2014-12-17 11:27 __夜风 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include#includeusing namespace std;int main(){ int i,j,T; char a[100]; cin>>T; while(cin>>a,T--) { j=strlen(a)-1; int... 阅读全文
posted @ 2014-12-17 11:25 __夜风 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #includeusing namespace std;int main(){ int gcd(int,int); int i,j,b=1; int a[1000]; while(cin>>j) { b=1; for(i=0... 阅读全文
posted @ 2014-12-17 11:24 __夜风 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include using namespace std;int main(){ char a[100],*p; int max,i; while(cin>>a){ max=int(a[0]); p=a; for(i=0;a[i]!='\0'... 阅读全文
posted @ 2014-12-17 11:24 __夜风 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include int main(){ int i,n,a[100]; while(scanf("%d",&n)!=EOF) { int max=0,min=99999999,sum=0; for(i=1;imax) max=a[i]; ... 阅读全文
posted @ 2014-12-17 11:21 __夜风 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include using namespace std;int main(){ int i,m,n; while(cin>>n) { m=1; for(i=n-1;i>=1;i--) m=(m+1)*2; cout<<... 阅读全文
posted @ 2014-12-17 11:20 __夜风 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 最小生成树模板题 简单的prim算法 AC代码: #include #include #define INF 9999999using namespace std;int map[200][200],dis[200],vis[200];int prim(int n){ int i,j,... 阅读全文
posted @ 2014-12-17 11:16 __夜风 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 这个题目真心赞,入门经典啊!O(∩_∩)O哈哈哈~ hdu 1089#include #include #include #include #include using namespace std;int main(){ int a,b; while(cin>>a>>b) ... 阅读全文
posted @ 2014-12-17 11:11 __夜风 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 水题 最长递增子序列和,dp更好 AC代码: #include #include #define MAX(a,b) a>b?a:busing namespace std;int main(){ int i,sum[1000],a[1000],n,j; while(cin>>n&&... 阅读全文
posted @ 2014-12-17 11:06 __夜风 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 水题 AC代码: #include using namespace std;int main(){ int i,k,t,y,n; cin>>t; while(t--) { k=0; cin>>y>>n; for(i=y;;i+... 阅读全文
posted @ 2014-12-17 11:03 __夜风 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 貌似之前也写过这个题目的解题报告。。。老了,记性不好 从贴一遍吧! 代码理解很容易 AC代码: #include #include #include using namespace std;#define N 8000int main(){ int i,j,k,t,n; int a[... 阅读全文
posted @ 2014-12-17 11:01 __夜风 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 水题 栈运用的基础题 注释都在代码里 AC代码: #include#include#define max 100using namespace std;int main(){ stacks; int n,i,j,k,result[max];//n为列车个数, result数组用来表示... 阅读全文
posted @ 2014-12-17 10:56 __夜风 阅读(138) 评论(0) 推荐(0) 编辑