摘要:
#include<iostream>#include<map>#include<string>using namespace std; int main(){ map<string ,int> m; int n; cin>>n; for(int i=0;i<n;i++) { string s; string t; cin>>s; m[s]++; getline(cin,t); } for(map<string,int>::iterator it=m.begin();it!=m.end... 阅读全文
posted @ 2012-04-28 12:24
open your eyes
阅读(130)
评论(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
阅读(230)
评论(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
阅读(153)
评论(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
阅读(149)
评论(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
阅读(187)
评论(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
阅读(196)
评论(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
阅读(170)
评论(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
阅读(153)
评论(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
阅读(158)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<string>#include<cmath>using namespace std;int main(){ string s; while(cin>>s) { if(s=="0")break; int len=s.length(),i; long long sum=0; for(i=len;i>0;i--) { sum+=(s[len-i]-'0')*((int)pow(2.0,i*1.0)-1); } ... 阅读全文
posted @ 2012-04-28 12:13
open your eyes
阅读(116)
评论(0)
推荐(0)

浙公网安备 33010602011771号