04 2012 档案

摘要:越栈了,比如数组开的不够大编译错误时Compilation Error Runtime Error (RE) : 运行时错误,这个一般是程序在运行期间执行了非法的操作造成的。以下列出常见的错误类型:ACCESS_VIOLATION 您的程序想从一些非法的地址空间读取或向其中写入内容。一般例如指针、数组下标越界都会造成这个错误的。 ARRAY_BOUNDS_EXCEEDED 您的程序试图访问一个超出硬件支持范围的数组单元。 FLOAT_DENORMAL_OPERAND 进行了一个非正常的浮点操作。一般是由于一个非正常的浮点数参与了浮点操作所引起的,比如这个数的浮点格式不正确。 FLOAT_DIV 阅读全文
posted @ 2012-04-30 19:15 open your eyes 阅读(1381) 评论(0) 推荐(0)
摘要:对于一个用C++写的程序,被加载至内存后运行,最终走向死亡。程序的死亡大致有三种:自然死亡,即无疾而终,通常就是main()中的一个return 0;自杀,当程序发现自己再活下去已经没有任何意义时,通常会选择自杀。当然,这种自杀也是一种请求式的自杀,即请求OS将自己毙掉。有两种方式:void exit(int status)和void abort(void)。他杀,同现实不同的是,程序家族中的他杀行径往往是由自己至亲完成的,通常这个至亲就是他的生身父亲(还是母亲?)。C++并没有提供他杀的凶器,这些凶器往往是由OS直接或者间接(通过一些进程库,如pthread)提供的。 自然死是最完美的结.. 阅读全文
posted @ 2012-04-30 08:38 open your eyes 阅读(1348) 评论(0) 推荐(0)
摘要:C++ Stack(堆栈) 是一个容器类的改编,为程序员提供了堆栈的全部功能,——也就是说实现了一个先进后出(FILO)的数据结构。操作 比较和分配堆栈 empty() 堆栈为空则返回真 pop() 移除栈顶元素 push() 在栈顶增加元素 size() 返回栈中元素数目 top() 返回栈顶元素 Lists将元素按顺序储存在链表中. 与 向量(vectors)相比, 它允许快速的插入和删除,但是随机访问却比较慢. assign() 给list赋值 back() 返回最后一个元素 begin() 返回指向第一个元素的迭代器 clear() 删除所有元素 empty() 如果list是空的则返 阅读全文
posted @ 2012-04-29 22:37 open your eyes 阅读(311) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <stdlib.h>#include <math.h>int T,k,n,ans,s;int main(){ scanf("%d",&T); for(int t=0;t<T;t++) { if(t) printf("\n"); scanf("%d",&k); if(!k){ printf("3\n"); continue; } k=abs(k); n=(int)sqrt(double(k<<1 阅读全文
posted @ 2012-04-29 09:30 open your eyes 阅读(221) 评论(0) 推荐(0)
摘要:#include<cstdio>#include<cstring>#include<cctype>#include<iostream>using namespace std;int main(){// freopen("input.txt", "r", stdin);// freopen("output.txt", "w", stdout); int c, m, j,n, k; char grid[60][60], word[60]; int md[8] = {-1, 阅读全文
posted @ 2012-04-29 09:29 open your eyes 阅读(173) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cstring>#include<cctype>using namespace std;int main(){ int m,flag=1,n; while(cin>>m>>n) { cin.ignore(); char ch[100][100]; char c[100][100]; char ci[100]; int a[100]; memset(a,0,sizeof(a)); for(int i=0;i<m;i++) ... 阅读全文
posted @ 2012-04-29 09:29 open your eyes 阅读(230) 评论(0) 推荐(0)
摘要:#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 阅读(200) 评论(0) 推荐(0)
摘要:#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 阅读(312) 评论(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 阅读(270) 评论(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 阅读(870) 评论(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 阅读(139) 评论(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 阅读(137) 评论(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 阅读(236) 评论(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 阅读(211) 评论(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 阅读(289) 评论(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 阅读(168) 评论(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 阅读(133) 评论(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 阅读(242) 评论(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 阅读(233) 评论(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 阅读(151) 评论(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 阅读(155) 评论(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 阅读(188) 评论(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 阅读(197) 评论(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 阅读(172) 评论(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 阅读(160) 评论(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 阅读(156) 评论(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 阅读(157) 评论(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 阅读(117) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int m,n; while(cin>>m>>n) { cout<<m*n-1<<endl; } return 0;} 阅读全文
posted @ 2012-04-28 12:12 open your eyes 阅读(108) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cmath>using namespace std;int main(){ int n; while(cin>>n) { unsigned long long a[10]={0}; int i,j; for(i=1;i<=n;i++) { a[0]+=i*i; } a[1]=(n*(n+1)/2)*(n*(n+1)/2); a[1]=a[1]-a[0]; for(i=1;i<=n;i++)... 阅读全文
posted @ 2012-04-28 12:11 open your eyes 阅读(139) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cmath>using namespace std;int main(){ long long n; while(cin>>n) { if(n==0)break; n=(n-1960)/10+2; double flag1=pow(2.0,n+0.0)*log10(2.0); double flag2=0.0; for(int i=1;;i++) { flag2+=log10(i+0.0); i... 阅读全文
posted @ 2012-04-28 12:11 open your eyes 阅读(143) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ long long m,n,flag=1; while(cin>>m>>n) { if(m==0&&n==0)break; long long sum=0; sum=m*(m-1)*n*(n-1)/4; cout<<"Case "<<flag++<<": "<<sum<<endl; }} 阅读全文
posted @ 2012-04-28 12:10 open your eyes 阅读(122) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int sum; cin>>sum; while(sum--) { int m,n; int flag1,flag2; cin>>m>>n; flag1=m/3; flag2=n/3; cout<<flag1*flag2<<endl; } return 0;} 阅读全文
posted @ 2012-04-28 12:10 open your eyes 阅读(80) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cstdio>using namespace std;int main(){ int k; int a[10010]; int b[10010]={0}; while(cin>>k) { int flag=0,j,r,temp; char c; while(scanf("%d%c",&temp,&c)==2) { a[flag++]=temp; if(c=='\n')break; } ... 阅读全文
posted @ 2012-04-28 12:10 open your eyes 阅读(137) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int H,U,D,F; while(cin>>H>>U>>D>>F) { if(H==0)break; int i; double temp=double(U)*(F/100.0); double sum=U; for(i=1;;i++) { if(sum>H) { cout<<"success on day "<<i... 阅读全文
posted @ 2012-04-28 12:09 open your eyes 阅读(158) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int sum; cin>>sum; while(sum--) { int m,n,i; cin>>m>>n; int dis=n-m; if(dis==0) cout<<"0"<<endl; else { for(i=0;;i++) { if(dis==i*i) ... 阅读全文
posted @ 2012-04-28 12:09 open your eyes 阅读(143) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cstdio>using namespace std;int main(){ int n; double s; while(cin>>n) { if(n<0)break; if(n<=1)s=0; else s=n; s=s*25.0; printf("%.lf%%\n",s); } return 0;} 阅读全文
posted @ 2012-04-28 12:09 open your eyes 阅读(120) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cmath>using namespace std;int main(){ int m,n; while(cin>>m>>n) { if(m==0&&n==0)break; if(m==n&&n==1) cout<<"0 1"<<endl; else { int k=1; for(k=1;;k++) { if((int)(pow(1+pow(n,1.0... 阅读全文
posted @ 2012-04-28 12:08 open your eyes 阅读(235) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int n; cin>>n; cin.ignore(); while(n--) { long long a; cin>>a; cin.ignore(); if(a<0) a=-a; if(a==0) cout<<"3"<<endl; else { long long temp=0; ... 阅读全文
posted @ 2012-04-28 12:08 open your eyes 阅读(171) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int n,v=1; while(cin>>n) { cin.ignore(); if(n==0)break; int i,j,a[60],sum=0; for(i=0;i<n;i++) { cin>>a[i]; cin.ignore(); sum+=a[i]; } sum=sum/n; int fla... 阅读全文
posted @ 2012-04-28 12:08 open your eyes 阅读(119) 评论(0) 推荐(0)
摘要:#include<iostream>#include<map>#include<string>using namespace std;int main(){ string s; while(getline(cin,s)) { string sa,sb; sa=s.substr(0,6); sb=s.substr(6,6); } return 0;} 阅读全文
posted @ 2012-04-28 12:07 open your eyes 阅读(194) 评论(0) 推荐(0)
摘要:#include<iostream>#include<string>using namespace std;int main(){ int n; cin>>n; cin.ignore(); while(n--) { string m; getline(cin,m); if(m.compare("78")==0||m.compare("1")==0||m.compare("4")==0) cout<<"+"<<endl; else if(m[m.length 阅读全文
posted @ 2012-04-28 12:07 open your eyes 阅读(192) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cstdio>#include<cmath>using namespace std;int main(){ double n,p; double temp; while(scanf("%lf%lf",&n,&p)==2) { temp=pow(p,1/n); printf("%.lf\n",temp); } return 0;} 阅读全文
posted @ 2012-04-28 12:06 open your eyes 阅读(166) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int m; while(cin>>m) { if(m==0)break; if(m==1)cout<<"1 1"<<endl; else { int i,x=1,y=1; for(i=1;;i++) { if(m>=(i*i+1)&&m<=((i+1)*(i+1))) { ... 阅读全文
posted @ 2012-04-28 12:06 open your eyes 阅读(156) 评论(0) 推荐(0)
摘要:#include<iostream>#include<string>#include<cstring>#include<cstdio>using namespace std;const int MAXN=1000;class BigNumber{public: int len,s[MAXN];public: void cleanLeadZero(); void multiplyTen(int n); void divisionTen(int n); string str() const; BigNumber(); BigNumber(int n) 阅读全文
posted @ 2012-04-28 12:03 open your eyes 阅读(606) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cctype>#include<algorithm>#include<string>#include<map>using namespace std;int main(){ map <char,char> ch_in; ch_in.insert(make_pair('A','2')); ch_in.insert(make_pair('B','2')); ch_in.insert(make_pair(' 阅读全文
posted @ 2012-04-28 12:02 open your eyes 阅读(243) 评论(0) 推荐(0)
摘要:#include<iostream>#include<string>#include<algorithm>#include<cstdio>using namespace std;const string kStr("AJAJAJAJAJASASASASASABABABABABAKAKAKAKAKATUTUTUTUTUCUCUCUCUCULULULULULUDUDUDUDUDUMUMEMEMEMEVEVEVEVEVENENENENENEWEWEWEWEWEFEFEFOFOFOXOXOXOXOXOGOGOGOGOGOPOPOPOPOPOYO 阅读全文
posted @ 2012-04-28 12:02 open your eyes 阅读(172) 评论(0) 推荐(0)
摘要:#include<string>#include<iostream>#include<set>#include<cctype>#include<map>using namespace std;int main(){ string temp; set<string>no_key; multimap<string,string>key_title; while(getline(cin,temp)&&temp!="::") no_key.insert(temp); int temp 阅读全文
posted @ 2012-04-28 12:01 open your eyes 阅读(195) 评论(0) 推荐(0)
摘要:#include<iostream>#include<string>#include<algorithm>#include<cctype>using namespace std;struct Team{ string name; int team_rank; int total_point; int game_played; int wins; int ties; int losses; int goal_difference; int goal_scored; int goal_against; Team():name("" 阅读全文
posted @ 2012-04-28 12:01 open your eyes 阅读(175) 评论(0) 推荐(0)
摘要:#include<iostream>#include<vector>#include<string>#include<algorithm>using namespace std;int main(){ int n,i,j; while(cin>>n) { vector<string> vs; int max_len=0,col=1,hang=0; string temp; for(i=0;i<n;i++) { cin>>temp; vs.push_back(tem... 阅读全文
posted @ 2012-04-28 12:00 open your eyes 阅读(265) 评论(0) 推荐(0)
摘要:#include<iostream>#include<vector>#include<map>#include<cctype>#include<algorithm>#include<string>#include<cstring>using namespace std;string to_lower(const string s){string temp;for(int i=0;i<s.length();i++)temp[i]=tolower(s[i]);return temp;}bool is_equa 阅读全文
posted @ 2012-04-28 12:00 open your eyes 阅读(194) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int n,i,j; cin>>n; while(n--) { int m,train[60],sum=0; cin>>m; for(i=0;i<m;i++) cin>>train[i]; for(i=0;i<m;i++) { for(j=i+1;j<m;j++) { if(train[i]>train[j]... 阅读全文
posted @ 2012-04-28 11:59 open your eyes 阅读(200) 评论(0) 推荐(0)
摘要:#include<iostream> #include<cstring> #include<string> #include<cstdio> #include<fstream> #define maxn 10010 using namespace std; int n; char m[maxn]; int mmm=0; void add(char *n1,char *n2,char *re) //两数相加,结果存在re里面 { int i=0,j=0; int len1=strlen(n1); int len2=strlen(n2); 阅读全文
posted @ 2012-04-28 11:54 open your eyes 阅读(184) 评论(0) 推荐(0)
摘要:#include<iostream>using namespace std;int main(){ int flag=1; long m,n; while(cin>>m>>n) { if(m==-1&&n==-1) break; long temp=1; cout<<"Case "<<flag<<": A = "<<m<<", limit = "<<n<<", number of terms 阅读全文
posted @ 2012-04-28 11:54 open your eyes 阅读(155) 评论(0) 推荐(0)
摘要:#include<iostream>#include<string>using namespace std;int main(){ string s[10]; string ss; int set=0,sum=0; while(cin>>ss) { cin.ignore(); if(ss=="9") { set++; int i,j,flag=0; for(i=0;i<sum;i++) { for(j=0;... 阅读全文
posted @ 2012-04-28 11:54 open your eyes 阅读(181) 评论(0) 推荐(0)
摘要:#include <iostream>#include<cstdio>//#include <string.h>#include <cstring>using namespace std;char str[55][55];int m,n;char bin[55];int dir[8][2] = {-1,-1,-1,0,-1,1,0,-1,0,1,1,0,1,-1,1,1};bool _strcmp (char *p,char *q){ int len = strlen (p); for (int i = 0; i < len; i++) i 阅读全文
posted @ 2012-04-28 11:52 open your eyes 阅读(249) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cstring>#include<cstdio>#include<cctype>using namespace std;char a[100][100];char s[]={"the quick brown fox jumps over the lazy dog"};char change[100];int ifFind(char a[]) { int i; int vis[100]; int ok=1; memset(vis,0,sizeof(vis)); for(i=0 阅读全文
posted @ 2012-04-28 11:52 open your eyes 阅读(282) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cmath>#include<algorithm>#include<vector>using namespace std;int main(){ int n; while(cin>>n) { vector<int> a(3000); vector<int> b(3000); cin>>a[0]; for(int i=1;i<n;i++) { cin>>a[i]; b[i]=abs(a[i]-a[i-1]);... 阅读全文
posted @ 2012-04-28 11:51 open your eyes 阅读(211) 评论(0) 推荐(0)
摘要:#include<iostream>#include<cstring>using namespace std;char a[100]="`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";int main(){ char ch[1000]; while(cin.getline(ch,1000)) { for(int i=0;i<strlen(ch);i++) { if(isgraph(ch[i])&&!isdigit(ch[i])) { ... 阅读全文
posted @ 2012-04-28 11:50 open your eyes 阅读(145) 评论(0) 推荐(0)
摘要:#include<iostream>#include<vector>#include<cmath>#include<cstring>#include<algorithm>using namespace std;int main(){ int n,a[600]; cin>>n; while(n--) { int m,i; cin>>m; vector<int> sum(m,0); for(i=0;i<m;i++) { cin>>a[i]; } for(i... 阅读全文
posted @ 2012-04-28 11:50 open your eyes 阅读(98) 评论(0) 推荐(0)
摘要:#include <stdio.h>#include <string.h>char a[300]={'\0'},b[300]={'\0'};int mult[610]={0},na[300]={0},la,nb[300]={0},lb;int main(){ int i,j; while(scanf("%s%s",a,b)==2) { la=strlen(a); lb=strlen(b); for(i=0;i<la;i++) na[i]=a[la-1-i]-'0'; for(j=0;j<lb 阅读全文
posted @ 2012-04-28 11:49 open your eyes 阅读(169) 评论(0) 推荐(0)
摘要:1 #include<iostream> 2 #include<string> 3 using namespace std; 4 int main() 5 { 6 int n,i; 7 string sa,a,b; 8 string s[100],ss[100]; 9 while(cin>>n)10 {11 if(n==0)break;12 cin.ignore();13 for(i=0;i<n;i++)14 {15 getline(cin,s[i]);16 ... 阅读全文
posted @ 2012-04-28 11:46 open your eyes 阅读(132) 评论(0) 推荐(0)