上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 99 下一页

2011年5月3日

Elevator

摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int A[110],t=0;void fun(int x ){ if(x-1==-1) t+=A[x]*6+5; else if(A[x]>A[x-1]) t+=(A[x]-A[x-1])*6+5; else if(A[x]<A[x-1]) t+=(A[x-1]-A[x])*4+5; else if(A[x]==A[x-1]) t+=5; }int main( ){ int N,i; while(scanf("%d",& 阅读全文

posted @ 2011-05-03 17:34 more think, more gains 阅读(171) 评论(0) 推荐(0) 编辑

Number Sequence

摘要: #include<stdio.h>#include<stdlib.h>int main( ){ int A,B,n,i,j,k,f[60]; while(scanf("%d%d%d",&A,&B,&n),A||B||n) { f[1]=1; f[2]=1; for(i=3;i<=50;i++) { f[i] = (A * f[n - 1] + B * f[n - 2]) % 7; if(f[i]=... 阅读全文

posted @ 2011-05-03 16:19 more think, more gains 阅读(158) 评论(0) 推荐(0) 编辑

Let the Balloon Rise

摘要: #include<stdio.h>#include<string.h>int main( ){ char ch[1100][20]; int d[1100],visit[1100],N,M,i,j,t; while(scanf("%d",&N),N) { t=0; for(i=0;i<=N;i++) d[i]=1; memset(visit,0,sizeof(visit)); for(i=0;i<... 阅读全文

posted @ 2011-05-03 15:40 more think, more gains 阅读(206) 评论(0) 推荐(0) 编辑

Strange fuction

摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>double fun1(double x,double y){ return 6*x*x*x*x*x*x*x+8*x*x*x*x*x*x+7*x*x*x+5*x*x-y*x;}double fun2(double x,double y){ return 42*x... 阅读全文

posted @ 2011-05-03 01:16 more think, more gains 阅读(295) 评论(0) 推荐(0) 编辑

二分查找

摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>int ab[1000];//二分查找 int find(int l,int r,int s) {while(l<=r){int mid=(l+r)>>1;if(ab[mid]==s) return 1;if(ab[mid]>s) r=mid-1; //注意这里不能写r=mid..否则死循环。else l=mid+1;}return 0;}int main( ){ int i; for(i=1;i<=60;i++) ab[i 阅读全文

posted @ 2011-05-03 00:46 more think, more gains 阅读(169) 评论(0) 推荐(0) 编辑

上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 99 下一页

导航