hd
残云墨雪
谁也不能把我左右,我会努力变得更好。
展开
-
汉诺塔III
#include <stdio.h>#include <stdlib.h>int main(){ int fx(int ); int n,m; while(~scanf("%d",&n)) { m=fx(n); printf("%d\n",m); } return 0;}int fx(int n){原创 2016-03-21 23:49:32 · 386 阅读 · 0 评论 -
Given a positive integer N, you should output the most right digit of N^N.
Problem DescriptionGiven a positive integer N, you should output the most right digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which原创 2016-06-30 11:28:40 · 6452 阅读 · 0 评论 -
骨牌铺方格
骨牌铺方格Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 46495 Accepted Submission(s): 22470Problem Description在2×n的一个长方形方格中,用一个1原创 2016-10-28 21:47:48 · 683 阅读 · 0 评论 -
整除的尾数
Problem Description 一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢?Input 输入数据有若干组,每组数据包含二个整数a,b(0<10000,10<b<100),若遇到0 0则处理结束。Output 对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没有空格。Sample Inpu原创 2017-09-02 21:48:23 · 298 阅读 · 0 评论 -
斐波那契的整除
Description 已知斐波那契数列有如下递归定义,f(1)=1,f(2)=1, 且n>=3,f(n)=f(n-1)+f(n-2),它的前几项可以表示为1, 1,2 ,3 ,5 ,8,13,21,34…,现在的问题是想知道f(n)的值是否能被3和4整除,你知道吗?Input 输入数据有若干组,每组数据包含一个整数n(1< n <1000000000)。Output 对应每组数据n,若 f(原创 2017-09-03 10:17:47 · 1277 阅读 · 0 评论