赵乐ACM

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年3月26日

摘要: 1. C++中string类的练习,使用的数据结构慢慢地开始有心得了;2. string类中的+=操作符和append( )函数的使用;3. 这道题很简单,开始出错是因为string类型的变量没有初始化。string str = "";//初始化为空字符串;4. 推荐一个c++的网站(cplusplus.com - The C++ Resources Network)。#include #include #include using namespace std; struct type { string str; char let; int len; }ltr[3... 阅读全文
posted @ 2012-03-26 22:30 赵乐ACM 阅读(218) 评论(0) 推荐(0)

摘要: 1. 好久没碰到这种难度的题了:看题没思路,经过思考,推算,一次AC。以前的题要不太难,只能看解题报告,要不太简单,不用思考,这种难度的题正好适合我;2. 具体思路是通过P序列还原成括号序列,然后通过括号序列得到W序列的值。注意map[ p[ i ] + i] = ‘)’。通过flag数组标记“)”之前的没有匹配的左括号;3. 这道题属于模拟题(以后知道题的类型就分个类);#include #include using namespace std; int main() { int i, j, k, tmp, t, n; int P, W[22], map[50], fl... 阅读全文
posted @ 2012-03-26 20:48 赵乐ACM 阅读(115) 评论(0) 推荐(0)

摘要: 1.物理题,不会求解。。。参考(http://blog.csdn.net/uestcshe/article/details/5621292)推出的公式,直接算出结果的;2. 第一次使用iostream输出有要求的小数。原来在书上看到的cout #include using namespace std; int main() { double Vs, R, C, w, Vr; int n; cin >> Vs >> R >> C >> n; while (n--) { cin >> w; Vr = Vs * R * C ... 阅读全文
posted @ 2012-03-26 19:25 赵乐ACM 阅读(144) 评论(0) 推荐(0)

摘要: 1.题目的大意是给定三个数a1, a2, a3,求出一个数,这个数除以23, 28, 33得到的余数为a1, a2, a3;2.从网上查到用中国余数定理,以下是找到的资料:若某数x分别被d1、、…、dn除得的余数为r1、r2、…、rn,则可表示为下式:x=R1r1+R2r2+…+Rnrn+RD其中R1是d2、d3、…、dn的公倍数,而且被d1除,余数为1;R1 、R2…、Rn是d1、d2、…、dn-1的公倍数,而且被dn除,余数为1;D是d1、d2、…、的最小公倍数;R是任意整数,可根据实际需要决定;且d1、、…、必须互质,以保证每个Ri(i=1,2,…,n)都能求得.根据上面的条件求出常数R 阅读全文
posted @ 2012-03-26 13:24 赵乐ACM 阅读(140) 评论(0) 推荐(0)

摘要: 1.刚开始想成是整个圆了,所以一直出错;2.ceil()函数,第一次用,详见(ceil_百度百科)#include #include using namespace std; const double PI = 3.1415926; int main() { double x, y, n; cin >> n; for(int i = 1; i > x >> y; cout << "Property " << i << ": This property will begin eroding in ye 阅读全文
posted @ 2012-03-26 10:55 赵乐ACM 阅读(140) 评论(0) 推荐(0)