文章列表
读Visual C++ 开发经验技巧宝典第二章—-数据类型
一 Cstring
1. 初始化方法:
(1) 直接复制,如Cstring=”mingrisoft”;
(2) 通过构造函数初始化,如 CString str(‘ ’,100)//与分配100个字节,填充空格
char* p=”feiqiang”; Cstring(p);delete p.
Number Sequence
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 41692 Accepted Submission(s): 8995Problem Description
A number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given A, B, and n ...
Let the Balloon Rise
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 30911 Accepted Submission(s): 10169Problem Description
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favor ...
Problem Description
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.
Input
The first line of the input contains an integer T(1<=T<=20) which mean ...