- package IOInOutPakage;
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- public class CopyPic {
- public static void main(String[] args) throws IOException
- {
- BufferedReader buf = new BufferedReader(new FileReader("E://text.txt"));
- String len = null;
- while((len = buf.readLine()) != null)
- {
- System.out.print(len);
- }
- buf.close();
- }
- }
复制代码 输出结果是这样的:
package IOInOutPakage;import java.util.Random;public class MathDemo { /* public static void main(String[] args) { double d = Math.ceil(16.34);//ceil返回大于指定数据的最小整数。 double d1 = Math.floor(12.34);//floor返回小于指定数据的最大整数。 long l = Math.round(12.54);//四舍五入 System.out.println(d); System.out.println(d1); System.out.println(l); double d2 = Math.pow(2,3);//位运算 System.out.println(d2); } */ public static void main(String[] args) { Random r = new Random(); for(int i = 0; i<10; i++) { double math = r.nextInt(10)+1; System.out.println(math); } }}
|
|