没说的,水
#include
#include
using namespace std;
int factorial(int n)
{
if(n==1||n==0)
return 1;
else
return n*factorial(n-1);
}
int main()
{
cout<<"n e"<<endl;
cout<<"...
分类:
其他好文 时间:
2015-05-28 12:39:03
阅读次数:
185
题目大意:A(0) = 1 , A(1) = 1 , A(N) = X * A(N - 1) + Y * A(N - 2) (N >= 2).
And we want to Calculate S(N) , S(N) = A(0) 2 +A(1) 2+……+A(n) 2. 解题思路:将An^2化开,得x * x * A(n-1) * A(n-1) + y * y * A(n-2) * A(n-2)...
分类:
其他好文 时间:
2015-05-28 09:37:41
阅读次数:
202
1381. a*b
Constraints
Time Limit: 1 secs, Memory Limit: 32 MB
Description
Give two positive integers a and b, please help us calculate a*b.
Input
The first line of the input is a positive inte...
分类:
其他好文 时间:
2015-05-28 09:35:58
阅读次数:
228
对一个加减乘除程序进行检测文中所有代码见daixiaomao Github1.首先写一个Calculate类,包括加减乘除法,这里只写最最简单的,主要为了使用Junit2.下载jar包 junit:链接。 需要注意的是,如果是用4.11及以上版本的话,同时还要下载hamcrest 1.3(下载地址)...
分类:
其他好文 时间:
2015-05-27 00:39:06
阅读次数:
287
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 =...
分类:
其他好文 时间:
2015-05-26 21:32:01
阅读次数:
114
Problem 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, you are to calculate the value of f(n).
Input
The i...
分类:
其他好文 时间:
2015-05-26 21:31:08
阅读次数:
131
Problem Description
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.
Input
The first line of the input contains an integer T(1
Output
F...
分类:
其他好文 时间:
2015-05-26 18:47:18
阅读次数:
148
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 34902 Accepted Submission(s): 15711
Problem Description
A simple mathematical formu...
分类:
其他好文 时间:
2015-05-26 14:26:08
阅读次数:
72
Calculate the FunctionProblem's Link: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3772Mean:略analyse:简单的线段树维护矩阵。矩阵乘法的结合律(a * b * c == ...
分类:
其他好文 时间:
2015-05-25 23:44:17
阅读次数:
189
这篇文章主要将要介绍JUnit测试工具的使用。本文中待测试的对象为一个简单的Calculate类,包括加(add),减(substract),乘(multiply),除(divide)四个简单的方法。 1 public class Calculate { 2 3 public st...
分类:
其他好文 时间:
2015-05-25 21:50:13
阅读次数:
165