随笔分类 -  C/C++

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
摘要:本题目给出的射击比赛的规则非常简单,谁打的弹洞距离靶心最近,谁就是冠军;谁差得最远,谁就是菜鸟。本题给出一系列弹洞的平面坐标(x,y),请你编写程序找出冠军和菜鸟。我们假设靶心在原点(0,0)。 输入格式: 输入在第一行中给出一个正整数 N(≤ 10 000)。随后 N 行,每行按下列格式给出: 其 阅读全文
posted @ 2019-07-14 16:55 wydxry 阅读(325) 评论(0) 推荐(0)
摘要:如果两个整数各位数字的和是一样的,则被称为是“朋友数”,而那个公共的和就是它们的“朋友证号”。例如 123 和 51 就是朋友数,因为 1+2+3 = 5+1 = 6,而 6 就是它们的朋友证号。给定一些整数,要求你统计一下它们中有多少个不同的朋友证号。 输入格式: 输入第一行给出正整数 N。随后一 阅读全文
posted @ 2019-07-14 16:44 wydxry 阅读(270) 评论(0) 推荐(0)
摘要:输入两个非负 10 进制整数 A 和 B (≤),输出 A+B 的 D (1)进制数。 输入格式: 输入在一行中依次给出 3 个整数 A、B 和 D。 输出格式: 输出 A+B 的 D 进制数。 输入样例: 输出样例: 阅读全文
posted @ 2019-07-14 16:37 wydxry 阅读(232) 评论(0) 推荐(0)
摘要:Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to si 阅读全文
posted @ 2019-07-12 07:53 wydxry 阅读(273) 评论(0) 推荐(0)
摘要:This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students. Inp 阅读全文
posted @ 2019-07-11 21:33 wydxry 阅读(248) 评论(0) 推荐(0)
摘要:Excel can sort records according to any column. Now you are supposed to imitate this function. Input Specification: Each input file contains one test 阅读全文
posted @ 2019-07-11 21:11 wydxry 阅读(211) 评论(0) 推荐(0)
摘要:To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords 阅读全文
posted @ 2019-07-09 21:32 wydxry 阅读(251) 评论(0) 推荐(0)
摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number 阅读全文
posted @ 2019-07-09 16:55 wydxry 阅读(206) 评论(0) 推荐(0)
摘要:Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are fri 阅读全文
posted @ 2019-07-09 11:10 wydxry 阅读(185) 评论(0) 推荐(0)
摘要:本题要求实现一个函数,判断任一给定整数N是否满足条件:它是完全平方数,又至少有两位数字相同,如144、676等。 函数接口定义: 其中N是用户传入的参数。如果N满足条件,则该函数必须返回1,否则返回0。 裁判测试程序样例: 输入样例: 输出样例: 阅读全文
posted @ 2019-06-26 10:46 wydxry 阅读(557) 评论(0) 推荐(0)
摘要:In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is supe 阅读全文
posted @ 2019-06-23 19:13 wydxry 阅读(254) 评论(0) 推荐(0)
摘要:给定数字 0-9 各若干个。你可以以任意顺序排列这些数字,但必须全部使用。目标是使得最后得到的数尽可能小(注意 0 不能做首位)。例如:给定两个 0,两个 1,三个 5,一个 8,我们得到的最小的数就是 10015558。 现给定数字,请编写程序输出能够组成的最小的数。 输入格式: 输入在一行中给出 阅读全文
posted @ 2019-06-22 16:51 wydxry 阅读(232) 评论(0) 推荐(0)
摘要:本题要求实现一个打印非负整数阶乘的函数。 函数接口定义: 其中N是用户传入的参数,其值不超过1000。如果N是非负整数,则该函数必须在一行中打印出N!的值,否则打印“Invalid input”。 裁判测试程序样例: 输入样例: 输出样例: 阅读全文
posted @ 2019-06-22 15:56 wydxry 阅读(1582) 评论(0) 推荐(0)
摘要:Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N! Input One N in one line, process to the end of file. Output For ea 阅读全文
posted @ 2019-06-22 15:46 wydxry 阅读(404) 评论(0) 推荐(0)
摘要:A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a re 阅读全文
posted @ 2019-06-21 17:06 wydxry 阅读(237) 评论(0) 推荐(0)
摘要:给定一个 k 位整数 1 (0, ,, d​k−1​​>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 0,则有 2 个 0,3 个 1,和 1 个 3。 输入格式: 每个输入包含 1 个测试用例,即一个不超过 1000 位的正整数 N。 输出格式: 对 N 中每一种不同的个位数字,以 阅读全文
posted @ 2019-06-21 16:48 wydxry 阅读(247) 评论(0) 推荐(0)
摘要:People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, wher 阅读全文
posted @ 2019-06-21 16:41 wydxry 阅读(252) 评论(0) 推荐(0)
摘要:Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color 阅读全文
posted @ 2019-06-21 15:55 wydxry 阅读(193) 评论(0) 推荐(0)
摘要:Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specificat 阅读全文
posted @ 2019-06-19 18:55 wydxry 阅读(217) 评论(0) 推荐(0)
摘要:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door 阅读全文
posted @ 2019-06-19 18:37 wydxry 阅读(162) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
Live2D