随笔分类 - Java
筛选法找最大素数
摘要:import java.io.IOException;import java.util.Scanner;public class Sieve { static Scanner cin = new Scanner(System.in); public static void main(String[] args) { // We will compute all primes less than the value specified on the // command line, or, if no argument, all primes less than 100. int max ...
阅读全文
字符串的全排列
摘要:/*以123的全排列为例:1 1232 1323 2314 2135 3126 321*//* 结果可以分为三部分:123 132; 213 231; 312 321; 对于123 132,去掉1后23可看作是其子问题*/import java.io.IOException;public class PermulateArray{ static int size; static int count=0; static char[] charArray; public static void main(String[] args)throws IOException{ String inpu..
阅读全文
Java版本icpc
摘要:import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.FileReader;import java.io.FileWriter;import java.io.IOException;import java.io.PrintWriter;import java.util.Scanner;public class Main{ public static Scanner cin=new Scanner(new BufferedInputStream(System.in)); publ
阅读全文
浙公网安备 33010602011771号