|
|
back to boardString takes 1 space count extra when input is !!. Please help me out import java.util.*; import java.lang.*; public class Factorial{ public static void main(String[] args){ Scanner cin=new Scanner(System.in); int n=Integer.parseInt(cin.next()); String k=cin.nextLine(); int j=k.length()-1; int sum=1; for(int i=n;i>0;i-=j){ sum=sum*i; } System.out.println(sum); } } |
|
|