摘要: string类的构造函数:string(const char *s); //用c字符串s初始化string(int n,char c); //用n个字符c初始化此外,string类还支持默认构造函数和复制构造函数,如string s1;string s2="hello";都是正确的写法。当构造的string太长而无法表达时会抛出length_error异常string类的字符操作:const char &operator[](int n)const;const char &at(int n)const;char &operator[](int n); 阅读全文
posted @ 2012-02-29 09:13 wuzhibin 阅读(774) 评论(0) 推荐(0)
摘要: Problem : 1018 ( Big Number ) Judge Status : AcceptedRunId : 5383214 Language : G++ Author : billforumCode Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta#include <iostream>#include <cmath>using namespace std;int main(){ int n, num; cin >> n; for(int i=0;i<n; 阅读全文
posted @ 2012-02-20 19:05 wuzhibin 阅读(254) 评论(0) 推荐(0)
摘要: 求N!位数本质求 :log10(N!)+1log10(N!)=log10(1*2*3*4*5…………*N)=log10(1)+log10(2)+………………+log10(N);ans=1;for(int i=1;i<=N;i++)ans+=log10(i); 阅读全文
posted @ 2012-02-20 18:27 wuzhibin 阅读(177) 评论(0) 推荐(0)
摘要: /*This Code is Submitted by billforum for Problem 2183 at 2012-02-20 15:36:33*/#include <iostream>#include <memory.h>#include <stdlib.h>#include <cstdio>#include <cstring>#include <cmath>using namespace std;int main(){ int n; double x0,y0,x1,y1,x2,y2; double ans,v 阅读全文
posted @ 2012-02-20 15:39 wuzhibin 阅读(186) 评论(0) 推荐(0)
摘要: Source CodeProblem: 1654 User: billforum Memory: 948K Time: 32MS Language: C++ Result: Accepted Source Code #include <iostream>#include <memory.h>#include <stdlib.h>#include <cstdio>#include <cstring>#include <cmath>using namespace std;char str[1000005];int main() 阅读全文
posted @ 2012-02-20 15:24 wuzhibin 阅读(226) 评论(0) 推荐(0)
摘要: #include <iostream>#include <memory.h>#include<cstdio>using namespace std;int main(){ int x; int a,b,suma,sumb; while(cin>>x) { if(x==0) break; a=1; b=1; suma=1; sumb=1; for(int i=1;i<=x;i++) { a=(a*5)%29; b=(b*401)%29; ... 阅读全文
posted @ 2012-02-18 16:56 wuzhibin 阅读(201) 评论(0) 推荐(0)
摘要: /*This Code is Submitted by billforum for Problem 1017 at 2012-02-17 22:42:30*/#include <cstdio>#include <iostream>#include <stdlib.h>#include <memory.h>#include <math.h>#include <string.h>using namespace std;int a[19];int main(){ int k,m,ans; a[10]=93313; a[11]=4 阅读全文
posted @ 2012-02-17 22:44 wuzhibin 阅读(421) 评论(0) 推荐(0)
摘要: /*This Code is Submitted by billforum for Problem 1016 at 2012-02-17 17:33:40*/#include <cstdio>#include <iostream>#include <stdlib.h>#include <memory.h>#include <math.h>#include <string.h>using namespace std;const int N=3510;const int M=50000;int pr[N+1],pn=0;boo 阅读全文
posted @ 2012-02-17 17:35 wuzhibin 阅读(233) 评论(0) 推荐(0)
摘要: Source CodeProblem: 2244 User: billforum Memory: 252K Time: 32MS Language: C++ Result: Accepted Source Code #include <cstdio>#include <iostream>#include <stdlib.h>#include <memory.h>#include <math.h>#include <string.h>using namespace std;int main(){ int n,m; while 阅读全文
posted @ 2012-02-17 17:07 wuzhibin 阅读(271) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2925Problem : 2925 ( Musical Chairs ) Judge Status : AcceptedRunId : 5366197 Language : G++ Author : billforumCode Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta#include <cstdio>#include <iostream>#include <stdlib.h>#inc 阅读全文
posted @ 2012-02-17 16:08 wuzhibin 阅读(243) 评论(0) 推荐(0)