hbase installation and verification

2023-01-23   ES  

Resource limit
Time limit: 1.0s Memory limit: 256.0MB
Question description
Given N and Len, output n! Len bit at the end.
Input format
one line two positive integers n and len.
output format
One -line string represents the answer. The length is not enough to make up the front zero replenishment.
Sample input
6 5
Sample output
00720
Data scale and agreement
  n<=30, len<=10。

packageTenth Simulation;

import java.math.BigInteger;
import java.util.Scanner;

public classsteps{
    
	public static void main(String[] args) {
    
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int len = sc.nextInt();
		sc.close();
		BigInteger  num1 = new BigInteger(n+"");
		for (int i = 2; i <n; i++) {
    
			BigInteger  num2 = new BigInteger(i+"");
			num1=num1.multiply(num2);
		}
		String s = num1+"";
		if(s.length()>len){
    
			s=s.substring(s.length()-len);
		}
		else{
    
			while(s.length()<len){
    
				s="0"+s;
			}
		}
		System.out.println(s);
  	}

}

source

Related Posts

CSS Learning Notes | CSS background

[Translation] CSCMATRIX

One -dimensional array & two -dimensional array & symmetrical matrix & triangular matrix & three -diagonal diagonal matrix site

Griffin installation

hbase installation and verification

Random Posts

MySQL data table generates the ER diagram workbench

Support vector machine (3) core function

ORA-22922: Record of the LOB value solution that does not exist

spoj -LCS Longest Common Substring suffix

Inquiry API