摘要: #include<iostream>#include<string>#include<cstring>using namespace std;int main(){ int n,sum[15][3]; char s[15][30]; while(cin>>n) { if(n==0)break; cin.ignore(); for(int i =0;i<n;i++) { cin.getline(s[i],30); for(int j=... 阅读全文
posted @ 2012-04-29 09:28 open your eyes 阅读(198) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cstring>using namespace std;int aa[15],bb[50];void print(){ int i; for(i=1;i<41;i++) { if(bb[i]==0) cout<<" "; else if(bb[i]==1) cout<<"."; else if(bb[i]==2) cout<<"x"; else cout<<"W"; } ... 阅读全文
posted @ 2012-04-29 09:27 open your eyes 阅读(267) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>char s[140];int len,i,j,a=0,b;int main(){ while (fgets(s,140,stdin)) { len =strlen(s); for (i=0;i<len;i++) { if (s[i]>48 && s[i]<58) { b = s[i]-'0'; a+=b... 阅读全文
posted @ 2012-04-29 09:27 open your eyes 阅读(866) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<cstring>#include<string>using namespace std;char s[100000];int main(){ while(cin.getline(s,100000)) { for(int i=0;i<strlen(s);i++) { cout<<char(s[i]-'1'+'*'); } cout<<endl; memset(s,0,sizeof(s)); } return 0;} 阅读全文
posted @ 2012-04-29 09:26 open your eyes 阅读(137) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>long abs(long x){ return x>0?x:-x;}int main(){ /**//* freopen("data.in","r",stdin); freopen("data.out","w",stdout); //*/ long n; scanf("%ld",&n); for(long cas=1;cas<=n;cas++) { long amp,fre; scanf("%ld%ld",& 阅读全文
posted @ 2012-04-28 12:29 open your eyes 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<stdlib.h>#define MAX_INT 2147483647char num1[300],num2[300];int main(){ char c; while (scanf("%s %c %s", num1, &c, num2)==3) { printf("%s %c %s\n", num1, c, num2); double a, b; a = atof(num1); b = atof(num2); if (a > ... 阅读全文
posted @ 2012-04-28 12:29 open your eyes 阅读(234) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>const int max=105;int main() { int i,j,k,han=0,len[max],maxlen=0; char a[max][max]; for (i=0;i<max;i++) { for (j=0;j<max;j++) { a[i][j]='\0'; } } i=0; while (gets(a[i])){ ... 阅读全文
posted @ 2012-04-28 12:28 open your eyes 阅读(208) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>#include<cstdio>#include<cstring>using namespace std;int flag,flag2;string sa;int find(char a){ int flag1=0; for(int i=0;i<sa.length();i++) { if(sa[i]==a) { sa[i]='*'; flag1++; flag2--; } } return ... 阅读全文
posted @ 2012-04-28 12:28 open your eyes 阅读(288) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>#include<cctype>#include<cstring>using namespace std;char s[100000];int main(){ while(cin.getline(s,100000)) { int sum=0,i=0; while(i<strlen(s)) { if(isalpha(s[i])&&!isalpha(s[i+1])) { sum++; ... 阅读全文
posted @ 2012-04-28 12:27 open your eyes 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #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 阅读(128) 评论(0) 推荐(0) 编辑