package ru.job4j.loop;

/**
 * Factorial.
 * @author Ivan Belyaev
 * @since 19.06.2017
 * @version 1.0
 */
public class Factorial {
	/**
	 * The method determines the factorial.
	 * @param n - the number for which factorial is defined by
	 * @return returns the factorial of a number
	 */
	public int calc(int n) {
		if (n < 2) {
			return 1;
		}

		int fact = 1;
		for (int i = 2; i <= n; i++) {
			fact *= i;
		}
		return fact;
	}
}

@@ -312,41 +312,8 @@
 ) %7B%0A
-%09%09if (n %3C 2) %7B%0A%09%09%09return 1;%0A%09%09%7D%0A%0A
 %09%09in
@@ -339,17 +339,17 @@
 int i = 
-2
+1
 ; i %3C= n

task 193