|
|
back to boardTest 9 why.Help me !!! Give me test. This is,,,, Posted by Hamdam 3 Oct 2007 18:03 import java.io.*; import java.util.*; import java.lang.*; import java.math.*; public class misol { public static void main(String[]args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); BigInteger[] a=new BigInteger[22]; BigInteger s=new BigInteger("1"); a[0]=new BigInteger("1"); a[1]=new BigInteger("1"); for(int i=2;i<=n;i++) { s=s.multiply(new BigInteger(Integer.toString(i))); a[i]=s; } s=new BigInteger("0"); if (n>2) { for (int i=0;i<=n-2;i++) s=s.add(a[n].divide(a[i]));
System.out.println(s); } else { if(n==2){System.out.println("2");} } } }
Re: Test 9 why.Help me !!! Give me test. This is,,,, Salom Hamdam sani shu misol utgan yili echisha uringan akansan misol oson,lekin ozginaqiyin joyi bor 3 soat bari shu misol ustidaman uzi oson ekan javob chiqsa sanga yaraman bollarga salom ayt.
Re: Test 9 why.Help me !!! Give me test. This is,,,, Hamdam koding hatosi shundaki 1<= n <= 21 n=1 Sani dasturing hech nima chiqarmaydi. Shuni uchun if(n==1)System.out.println("0"); qo'ysang AC olasan. H'op bo'pdi yozib tur man 6-kun,bozor kuni internetdaman |
|
|