![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
WCharlotte
这个作者很懒,什么都没留下…
展开
-
字母反转
#include<stdio.h>#include<string.h>int main(){char str[85],c; int l,i,j,k; while(gets(str)){// gets(str); l=strlen(str);// if(l==0)break; //**********这么写不过 ******原创 2017-05-15 22:54:19 · 1837 阅读 · 0 评论 -
国王的战争
Description国际象棋中的国王,可以攻击相邻的8个位置(即上、下、左、右和左上,左下,右上,右下),现在给定一个N * M的棋盘,以及其中放置的K个国王的位置,请问他们是否能够互相攻击。Input第一行:N M K——棋盘大小以及放置的国王数量(1<=n, m<=100, 0<=k<=200) 以后K行每行都包含两个值r和c,代表一个国王被放置在第r行第c列(棋盘的行序号从1到N,列序号从原创 2017-05-16 19:01:29 · 344 阅读 · 0 评论 -
LCM
Problem Description The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15原创 2017-07-08 16:32:34 · 513 阅读 · 0 评论 -
Number Sequence
Number SequenceProblem 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). Inp原创 2017-07-10 10:00:40 · 367 阅读 · 1 评论 -
Fibonacci Again
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 in原创 2017-07-10 10:21:37 · 246 阅读 · 0 评论