首先,要求找到最长最短字符串,我们应该用数组将其存起来,输入的个数是不固定的,我们就可以用Scanner获取要输入的个数,最终找到的个数也不固定,我们可以封装两个方法,并且返回值类型为数组. 我遇到的问题,开始我想到的是字符串拼接,么想到返回值用数组存,导致每次返回的个数都是固定的,就算有多个. 代码如下: import java.util.Scanner; //输入n行字符串,找出最长最短字符串(若有个数相同的,都打印出来) public class FindString { public s…
find the longest of the shortest Time Limit: 1000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2524 Accepted Submission(s): 888 Problem Description Marica is very angry with Mirko because he found a new gi…
package bianchengti; /* * 在由N个元素构成的集合S中,找出最小元素C,满足C=A-B, * 其中A,B是都集合S中的元素,没找到则返回-1 */ public class findMinValue { //快速排序 public static void sort(int a[], int low, int hight) { if (low > hight) { return; } int i, j, key; i = low; j = hight; key = a[i]…
B. Position in Fraction time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a fraction . You need to find the first occurrence of digit c into decimal notation of the fraction after de…
--期盼值 找出AA,3;PDST,3;QPL-,3;TP-,2; --基本表 create table tb_product( id number(9,0) primary key, name nvarchar2(20) not null); --基本表充值 insert into tb_product(id,name) values('','AA'); insert into tb_product(id,name) values('','AA款'); insert into tb_produ…