摘要: #include#include#include#include#includeusingnamespacestd;intmain(void){ intn,t; intnum[100][100]; while(cin>>n){ if(n==0){ break; } if(n%2!=1||n... 阅读全文
posted @ 2013-07-18 15:02 白洞 阅读(190) 评论(2) 推荐(1) 编辑
摘要: #include#include#include#include#includeusingnamespacestd;intmain(void){ intn,t; intnum[100][100]; while(cin>>n){ if(n==0){ break; } if(n%2!=1||n... 阅读全文
posted @ 2013-07-18 15:01 白洞 阅读(195) 评论(0) 推荐(0) 编辑
摘要: #include #include #include int n,m,ans,p[1010];void Make(int *a){for(int i=1;i<=n;i++)p[i] = i;}int Find(int x){return x==p[x]?x:(p[x]=Find(p[x]));}vo... 阅读全文
posted @ 2013-04-22 20:11 白洞 阅读(174) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(){ int N,M; double p,q,rate,k; while(cin>>N>>M>>p>>q) { if(N==0){cout<<"0.00"<<endl;continue;} if(M==0)... 阅读全文
posted @ 2013-04-17 20:19 白洞 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #includeint main(){ int n; printf("# Cards Overhang\n"); while(scanf("%d",&n)!=EOF) { double sum=0.5; int i; for(i=2;i<=n;i++) sum+=1.0/(2*i); printf(... 阅读全文
posted @ 2013-04-16 21:00 白洞 阅读(165) 评论(0) 推荐(0) 编辑
摘要: # include int main (){ int n, ans, i ; puts ("PERFECTION OUTPUT") ; while (~scanf ("%d", &n),n) { for(i = 1,ans=0 ; i n)puts("ABUNDANT"); else if(ans=... 阅读全文
posted @ 2013-04-16 20:34 白洞 阅读(144) 评论(2) 推荐(0) 编辑
摘要: #include #include using namespace std;const int MAX = 1005;int father[MAX], rank[MAX];int n, m;void MakeSet(){ for (int i = 1; i > T; while (T--) { c... 阅读全文
posted @ 2013-04-16 19:58 白洞 阅读(126) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #define MAX 102 using namespace std; int map[MAX][MAX]; int main(){ int m,w,h,s,t,x,y,i,j,p,k; w... 阅读全文
posted @ 2013-04-08 21:05 白洞 阅读(130) 评论(0) 推荐(0) 编辑
摘要: #include#include#define max 10001 //素数表范围int flag[max+1]; //标志一个数是否为素数int prime[max+1]; //素数表,下标从0开始int size; //素数个数void main(){int i,j,size=0,M,sum,m... 阅读全文
posted @ 2013-04-02 20:06 白洞 阅读(304) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(){ int i,n,m,ans=0,a[100],r[100]; scanf("%d%d",&n,&m); for(i=0;i=a[j]){j++; ans++;} if(r[i]>=a[j]){j++;... 阅读全文
posted @ 2013-04-01 21:00 白洞 阅读(268) 评论(0) 推荐(0) 编辑