- 博客(13)
- 收藏
- 关注
原创 c语言Number Sequence
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 input ...
2020-03-22 16:44:31 485
原创 c语言Fibonacci Again
Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).Input Input consists of a sequence of lines, each containing an integer n. (n &l...
2020-03-21 14:59:27 338
原创 c语言人见人爱A^B
求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方”Input 输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1<=A,B<=10000),如果A=0, B=0,则表示输入数据的结束,不做处理。Output 对于每个测试实例,请输出A^B的最后三位表示的整数,每个输出占一行。Sample Input2 312 66789 100000 0...
2020-03-20 17:24:48 774
原创 c语言冒泡排序
6-3 冒泡排序 (15分)输入n(1<=n<=10)个整数,将它们从小到大排序后输出,要求编写函数bubble()实现冒泡排序算法。函数接口定义:void bubble (int a[ ], int n);其中 a为数组,n为数据个数。裁判测试程序样例:#include <stdio.h>void bubble (int a[ ], int n);int m...
2020-03-19 15:16:28 2935 1
原创 c语言Rightmost Digit
Problem Description Given a positive integer N, you should output the most right digit of N^N.Input The input contains several test cases. The first line of the input is a single integer T which is t...
2020-03-19 14:24:33 330
原创 最小公倍数
Problem Description 给定两个正整数,计算这两个数的最小公倍数。Input 输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数.Output 对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行。Sample Input10 14Sample Output70//辗转相除法,输入用!=EOF,控制到文件尾,要不然可能会超时#include<...
2020-03-18 16:00:11 156
原创 Elevator
Problem Description The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified o...
2020-03-17 16:59:16 75
原创 c语言6.0
Hey, welcome to HDOJ(Hangzhou Dianzi University Online Judge).In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + … + n.Input The input will consist of a series of integers n, one intege...
2020-03-16 15:57:32 118
原创 c语言5.0
Problem Description In many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are g...
2020-03-13 18:45:57 314
原创 c语言4.0
Problem Description Your task is to Calculate a + b.Input The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.Output For each pair of...
2020-03-12 13:12:21 307
原创 c语言3.0
Problem Description Your task is to calculate the sum of some integers.Input Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M inte...
2020-03-11 17:20:06 244
原创 C语言2.0
Problem Description Your task is to Calculate a + b.Input Input contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing...
2020-03-10 14:25:22 360
原创 c语言1.0
(Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 78 Accepted Submission(s) : 38Problem Description Your task is to Calculate a + b.Too easy?! Of course! I specially de...
2020-03-09 22:06:39 220
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人