package ru.job4j.loop;

/**
*Factorial number calculation. Task 4.2.
*@author Dmitriy Bobrov (mailto:bobrov.dmitriy@gmail.com)
*@since 0.1
*/
public class Factorial {
/**
*Class Counter.
*/

/**
*Calculation factorial.
*@param n - input value.
*@return sum - return factorial.
*/
	public int calc(int n) {
		return (n == 0) ? 1 : n * calc(n - 1);
	}
}
@@ -274,16 +274,19 @@
 al.%0A*/%0A%09
+// 
 public i
@@ -303,16 +303,19 @@
 t n) %7B%0A%09
+// 
 %09return 
@@ -346,12 +346,179 @@
 n - 1);%0A
+%09// %7D%0A%09public int calc(int n) %7B%0A%09%09int sum = 1;%0A%09%09for (int i = 2; i %3C= n; i++) %7B%0A%09%09%09if (n == 0) %7B%0A%09%09%09%09return sum;%0A%09%09%09%7D else %7B%0A%09%09%09%09sum = sum * i;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return sum;%0A
 %09%7D%0A%7D

Task 4.2 Max