试题 算法提高 8-1因式分解
资源限制
时间限制:10.0s 内存限制:256.0MB
问题描述
设计算法,用户输入合数,程序输出若个素数的乘积。例如,输入6,输出2*3。输入20,输出2*2*5。
import java.util.Scanner;
public class Main {
public static void main (String[] args) {
Scanner sc=new Scanner(System.in);
int a=sc.nextIn
试题 算法提高 菱形
请编程输出一个菱形。输入为菱形中心到顶点的距离
样例输入
2
样例输出
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.close();
char[]
试题 算法提高 Substrings
问题描述
You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings.
输入格式
The first line of the i