摘要: #include <iostream>#include <string>using namespace std;int main(){int N;cin>>N;while(N>0){string word;cin>>word;int a;cin>>a;int temp;for(int j=0;j<a;j++){int b;cin>>b;if(j==0){temp=b;continue;}if(word=="Faster"){if(temp>b)temp=b;}if(word==&quo 阅读全文
posted @ 2012-05-25 22:16 梨子 阅读(128) 评论(0) 推荐(0)
摘要: #include <iostream>#include <string>using namespace std;int main(){string in;int all,del,a;int length;while(cin>>in&&in!="0"){del=0;all=(in[0]-'0')*2;length=in.length();for(int i=1;i<length;i++){a=in[i]-'0';all=all*2+a*2;del=del+a;}all=all-del-( 阅读全文
posted @ 2012-05-25 12:48 梨子 阅读(110) 评论(0) 推荐(0)
摘要: #include <iostream>using namespace std;int main(){int n;int *a=new int[n];while(cin>>n&&n){ int i; int count1=0; int count2=0; for(int j=0;j<n;j++) cin>>a[j]; for( i=1;i<n;i++) { if(i%2==0&&a[i]!=a[0]) { count1++; continue; } if(i%2==1&&a[i]==a[0]) { c 阅读全文
posted @ 2012-05-25 12:08 梨子 阅读(146) 评论(0) 推荐(0)
摘要: #include <iostream>#include <string>using namespace std;int reverse(int k){int rev=0;while(k>0){rev=rev*10+k%10;k=k/10;}return rev;}int main(){int a,b,c,n;cin>>n;while(n>0){cin>>a>>b;a=reverse(a);b=reverse(b);c=a+b;c=reverse(c);cout<<c<<endl;n--;}retur 阅读全文
posted @ 2012-05-25 12:03 梨子 阅读(128) 评论(0) 推荐(0)