1 ~ 10 factorial java programming, factorial java programming
/* The following comments are obtained by writing the java content. If you have any misunderstanding, please be sure to provide guidance */
Import java. util. collections;
Public class jiecheng {
Public static void main (String [] args ){
New syntax = new syntax (System. in);/* The current row and the next row are in the fixed format of the java input statement */
System. out. println ("enter n (0 <n <= 10):");/* similar to C, which must be placed on the downstream */
Int n = cipher. nextInt ();/* similar to the scanf statement in C Language */
Int I, num = 1;/* use a cyclic statement to calculate the factorial, which is no different from the C language */
For (I = 1; I <= n; I ++ ){
Num * = I;
}
System. out. println (num);/* output statement. You can directly output the variable without using the format control operator in the C language */
}
}