欢迎来到天天文库
浏览记录
ID:46599712
大小:285.00 KB
页数:51页
时间:2019-11-26
《蓝桥杯 练习系统 算法训练答案Java》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、ALGO-9importjava.io.*;publicclassMain{publicstaticvoidmain(Stringargs[])throwsIOException{BufferedReaderbf=newBufferedReader(newInputStreamReader(System.in));intn=Integer.parseInt(bf.readLine());System.out.println((int)(Math.pow(2,n)-n-1)*2);}}10importjava.io.*;importjava.util.Arr
2、ays;importjava.util.HashSet;importjava.util.Iterator;importjava.util.Set;publicclassMain{publicstaticvoidmain(String[]args)throwsIOException{BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));intn=Integer.parseInt(br.readLine());int[]arr=newint[n];Stringst[]=br.re
3、adLine().split("");for(inta=0;a4、;}publicstaticvoidfunc(int[]arr,int[]tag){intx;for(inta=0;a=0){System.out.print(arr[a]+"");}}System.out.println();Setset=newHashSet();for(inta=0;a5、){set.add(tag[a]);}int[]sor=newint[set.size()];Iteratorit=set.iterator();while(it.hasNext()){for(inta=0;a6、=Arrays.binarySearch(tag,arr[a]);if(y<0){System.out.print(arr[a]+"");}}System.out.println();}}11importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scannerinput=newScanner(System.in);intn=input.nextInt();if(1<=n&&n<=10){if(n==1){System.out.println("1");}else7、{int[]tag=newint[n];tag[0]=1;tag[1]=2;if(n==1){System.out.println(tag[0]);}for(inta=2;a8、n{BufferedReaderbr=newBufferedRea
4、;}publicstaticvoidfunc(int[]arr,int[]tag){intx;for(inta=0;a=0){System.out.print(arr[a]+"");}}System.out.println();Setset=newHashSet();for(inta=0;a5、){set.add(tag[a]);}int[]sor=newint[set.size()];Iteratorit=set.iterator();while(it.hasNext()){for(inta=0;a6、=Arrays.binarySearch(tag,arr[a]);if(y<0){System.out.print(arr[a]+"");}}System.out.println();}}11importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scannerinput=newScanner(System.in);intn=input.nextInt();if(1<=n&&n<=10){if(n==1){System.out.println("1");}else7、{int[]tag=newint[n];tag[0]=1;tag[1]=2;if(n==1){System.out.println(tag[0]);}for(inta=2;a8、n{BufferedReaderbr=newBufferedRea
5、){set.add(tag[a]);}int[]sor=newint[set.size()];Iteratorit=set.iterator();while(it.hasNext()){for(inta=0;a6、=Arrays.binarySearch(tag,arr[a]);if(y<0){System.out.print(arr[a]+"");}}System.out.println();}}11importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scannerinput=newScanner(System.in);intn=input.nextInt();if(1<=n&&n<=10){if(n==1){System.out.println("1");}else7、{int[]tag=newint[n];tag[0]=1;tag[1]=2;if(n==1){System.out.println(tag[0]);}for(inta=2;a8、n{BufferedReaderbr=newBufferedRea
6、=Arrays.binarySearch(tag,arr[a]);if(y<0){System.out.print(arr[a]+"");}}System.out.println();}}11importjava.util.Scanner;publicclassMain{publicstaticvoidmain(String[]args){Scannerinput=newScanner(System.in);intn=input.nextInt();if(1<=n&&n<=10){if(n==1){System.out.println("1");}else
7、{int[]tag=newint[n];tag[0]=1;tag[1]=2;if(n==1){System.out.println(tag[0]);}for(inta=2;a8、n{BufferedReaderbr=newBufferedRea
8、n{BufferedReaderbr=newBufferedRea
此文档下载收益归作者所有