//*******引进静态成员变量的作用就是声明一个属于类而不属于对象的全局变量。意味着它为该类的所有实例所共享,//也就是说当某个类的实例修改了该静态成员变量,其修改值为该类的其它所有实例所见。//在某个类A中声明一个static int number;初始化为0。这个number就能被所有A的实...
分类:
其他好文 时间:
2014-06-29 00:00:21
阅读次数:
233
题目21:有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
1.程序分析:请抓住分子与分母的变化规律。
2.程序源代码:
main()
{
int n,t,number=20;
float a=2,b=1,s=0;
for(n=1;n<=number;n++)
{
s=s+a/b;
t=a;a=a+b;b=t;/*这部分是程序的关键...
分类:
其他好文 时间:
2014-06-18 11:44:33
阅读次数:
176
Teradata数据库中也有和oracle类似的分析函数,功能基本一样。示例如下:RANK() 函数SELECT * FROM salestbl ORDER BY 1,2;storeid prodid sales----------- ------- ---------1001 ...
分类:
其他好文 时间:
2014-06-18 10:29:26
阅读次数:
272
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:
其他好文 时间:
2014-06-18 10:17:40
阅读次数:
174
1. sizeof(literal-string) is number of bytes plus 1 (NULL is included), while strlen(literal-string) is number of bytes.2. Printf and scanf formatBefo...
分类:
其他好文 时间:
2014-06-18 10:14:22
阅读次数:
226
Problem Description
You are given N positive integers, denoted as x0, x1 ... xN-1. Then give you some intervals [l, r]. For each interval, you need to find a number x to make
as small as possible!
...
分类:
其他好文 时间:
2014-06-18 00:58:54
阅读次数:
276
Structural Things
An
active class is a class whose objects own one or
more processes or threads and therefore can initiate control activity. An active class is just like a class except that it...
分类:
其他好文 时间:
2014-06-17 22:44:27
阅读次数:
310
K-th Number
Time Limit: 20000MS
Memory Limit: 65536K
Total Submissions: 36045
Accepted: 11522
Case Time Limit: 2000MS
Description
You are working for Macrohard com...
分类:
其他好文 时间:
2014-06-17 22:17:07
阅读次数:
410
题目
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should rem...
分类:
其他好文 时间:
2014-06-17 22:15:52
阅读次数:
299
题目
Determine whether an integer is a palindrome. Do this without extra space.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to ...
分类:
其他好文 时间:
2014-06-17 16:12:39
阅读次数:
226