摘要: #include<iostream>#include<cstring>using namespace std;int a[1000+10],b[1000+10],temp[1000+10];bool is_break(int b[],int n){ int i,flag=0;; for(i=0;i<n;i++) { if(b[i]==0) flag++; } if(flag==n)return 1; else return 0;}int main(){ int n; int flag=1; while(c... 阅读全文
posted @ 2012-04-28 12:24 open your eyes 阅读(235) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ int n,m,i,temp,flag=1; while(cin>>m>>n) { if(m==0&&n==0)break; cout<<"CASE# "<<flag++<<":"<<endl; int a[10001]={0},b[10001]={0}; for(i=0;i<m;i++) { cin>>temp; a[temp]++; } 阅读全文
posted @ 2012-04-28 12:22 open your eyes 阅读(227) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<vector>using namespace std;int main(){ long long n; while(cin>>n) { if(n<0)break; if(n==1)cout<<" "<<1<<endl; else { vector<long long>v; long long i=2; while(true) { if(i*i>n... 阅读全文
posted @ 2012-04-28 12:16 open your eyes 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ int sum,flag=1; cin>>sum; while(sum--) { long long n,i=2; cin>>n; cout<<"Case #"<<flag++<<": "<<n<<" = "; int flag2=1; while(true) { if(n%i==0&&flag2==1) { cou... 阅读全文
posted @ 2012-04-28 12:16 open your eyes 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;int main(){ int n; while(cin>>n) { if(n==0) cout<<" "<<0<<" -> "<<1<<endl; else { int i,temp=1; for(i=1;i<=n;i++) { temp=temp*i; while(temp%10==0) temp=temp/10; ... 阅读全文
posted @ 2012-04-28 12:15 open your eyes 阅读(184) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<iomanip>using namespace std;int main(){ int m,n; while(cin>>m>>n) { cout<<setw(10)<<right<<m<<setw(10)<<right<<n<<" "; int temp1=1,temp2,temp3; temp2=m>n?m:n; temp3=m<n?m:n; while(temp1) { te 阅读全文
posted @ 2012-04-28 12:15 open your eyes 阅读(194) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include <algorithm>#include<vector>using namespace std;int main(){ int Z,I,M,L,flag=1; while(cin>>Z>>I>>M>>L) { if(Z==0&&I==0&&M==0&&L==0)break; int temp,temp2,i=0; temp=Z*L+I; vector<int>v; v.push_back(L); wh 阅读全文
posted @ 2012-04-28 12:15 open your eyes 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cmath>using namespace std;int main(){ long long n; while(cin>>n) { if(n==0)break; long long flag; flag=(int)sqrt((double)n); if(flag*flag==n) cout<<"yes"<<endl; else cout<<"no"<<endl; } return 0;} 阅读全文
posted @ 2012-04-28 12:14 open your eyes 阅读(150) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cmath>using namespace std;int main(){ int a,b,c; while(cin>>a>>b>>c) { int yushu=0; int i,temp=b,temp1; for(i=1;;i++) { if((b*c+yushu)!=temp) { temp1=yushu; yushu=(b*c+yushu)/a; ... 阅读全文
posted @ 2012-04-28 12:14 open your eyes 阅读(151) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<iomanip>using namespace std;#define MAXN 10010int main(){ double c[MAXN]; double a,b; int cases,n; cin>>cases; while(cases--) { cin>>n>>a>>b; double sum=0,tmp=0; for(int i=0;i<n;i++) { cin>>c[i]; } tmp=... 阅读全文
posted @ 2012-04-28 12:13 open your eyes 阅读(150) 评论(0) 推荐(0) 编辑