{"id":4678,"date":"2018-12-27T21:46:55","date_gmt":"2018-12-27T18:46:55","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4678"},"modified":"2018-12-27T23:30:06","modified_gmt":"2018-12-27T20:30:06","slug":"e-olymp-271-%d1%84%d0%b0%d0%ba%d1%82%d0%be%d1%80%d0%b8%d0%b0%d0%bb","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4678","title":{"rendered":"e-olymp 271. \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b!"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u041d\u0430\u0439\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 [latex]n[\/latex]\n<h1>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u041e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n(0\\leq n\\leq 3000)[\/latex].<\/p>\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0447\u0438\u0441\u043b\u0430 [latex]n[\/latex].<\/p>\n<h1>\u0422\u0435\u0441\u0442\u044b<\/h1>\n<table>\n<tbody>\n<tr>\n<th>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<th>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">3\n<\/td>\n<td style=\"text-align: center\">6<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">5<\/td>\n<td style=\"text-align: center\">120<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left\">1<\/td>\n<td style=\"text-align: center\">1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h1>\n<pre class=\"lang:java decode:true \" title=\"\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b!\">import java.util.Scanner;\r\nimport java.math.BigInteger;\r\n\r\npublic class factorial {\r\n  public static BigInteger factorial(int num){\r\n    BigInteger fact = BigInteger.valueOf(1);\r\n    for (int i = 1; i &lt;= num; i++)\r\n      fact = fact.multiply(BigInteger.valueOf(i));\r\n     return fact;\r\n}\r\n \r\n  public static void main(String[] args) throws java.lang.Exception{\r\n  Scanner input = new Scanner(System.in); \r\n  int x;\r\n  x = input.nextInt(); \r\n  System.out.println(factorial(x));\r\n  }\r\n}<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 [latex]n[\/latex] \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 [latex]1[\/latex] \u0434\u043e [latex]n[\/latex] \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e.<br \/>\n\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 [latex]factorial[\/latex] \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u0430. \u0410 \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0435\u0442\u043e\u0434 [latex]factorial[\/latex] \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 [latex]main[\/latex].<\/p>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<p><a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/271\">e-olymp<\/a><br \/>\n<a href=\"https:\/\/ideone.com\/sas8WL\">Ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u041d\u0430\u0439\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 [latex]n[\/latex] \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u041e\u0434\u043d\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n(0\\leq n\\leq 3000)[\/latex]. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b \u0447\u0438\u0441\u043b\u0430 [latex]n[\/latex]. \u0422\u0435\u0441\u0442\u044b \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 3 6 5 120 1 1 \u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b import java.util.Scanner; import java.math.BigInteger; public class factorial { public static BigInteger factorial(int num){ BigInteger fact = BigInteger.valueOf(1); for (int i = &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4678\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":127,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[660,140,231],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4678"}],"collection":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/users\/127"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4678"}],"version-history":[{"count":3,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4678\/revisions"}],"predecessor-version":[{"id":4721,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4678\/revisions\/4721"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}