摘要: #include<iostream>#include<cstring>#include<string>using namespace std;const int max=1000;struct bign{ int len; int s[max];};void init_bign(bign &b){ memset(b.s,0,sizeof(b.s)); b.len=1;}void fuzi_bign(bign &b,char *num){ b.len=strlen(num); for(int i=0;i<b.len;i++) b.s[i] 阅读全文
posted @ 2012-04-29 09:28 open your eyes 阅读(304) 评论(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 阅读(266) 评论(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 阅读(865) 评论(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 阅读(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 阅读(232) 评论(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 阅读(134) 评论(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 <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 阅读(206) 评论(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 阅读(165) 评论(0) 推荐(0) 编辑
摘要: #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) 编辑