zoukankan      html  css  js  c++  java
  • 0928-----homework

     1 /**
     2   *homework0928
     3   *@author:kai li
     4   */
     5 package com.kai.li.homework0928;
     6 import java.util.stream.IntStream;
     7 /**
     8   *following class is client 
     9   */
    10 public class HomeWork0928{
    11 
    12     public static void main(String[] args)throws Exception{
    13         
    14         /**
    15           *question one and two
    16           */
    17     
    18     Runnable runnable1=()->{
    19                 long timeStart=System.currentTimeMillis();
    20                 IntStream.range(1,101)
    21                 .mapToObj(i->"洛阳"+i)
    22                 .forEach(System.out::println);
    23                 long time1=System.currentTimeMillis()-timeStart;
    24                 System.out.println(time1);
    25             };
    26     Runnable runnable2=()->{
    27                 long timeStart=System.currentTimeMillis();
    28                 IntStream.range(1,101)
    29                 .mapToObj(i->"长安"+i)
    30                 .forEach(System.out::println);
    31                 long time2=System.currentTimeMillis()-timeStart;
    32                 System.out.println(time2);
    33             };
    34     Runnable runnable3=()->{
    35                 IntStream.range(1,101)
    36                 .mapToObj(i->"runnable3:燕京"+i)
    37                 .forEach(System.out::println);
    38             };
    39     Thread thread1=new Thread(runnable1);
    40     Thread thread2=new Thread(runnable2);
    41     Thread thread3=new Thread(runnable3);
    42     thread1.start();
    43     thread2.start();
    44     thread3.start();
    45 
    46     IntStream.range(1,101)
    47                 .mapToObj(i->"main:开封府"+i)
    48                 .forEach(System.out::println);
    49     
    50     }
    51 }
  • 相关阅读:
    hdu4665 DFS
    hdu4665 DFS
    hdu4717 三分(散点的移动)
    POJ 2559 Largest Rectangle in a Histogram(单调栈) && 单调栈
    洛谷 P2347 砝码称重
    洛谷 P3009 [USACO11JAN]利润Profits
    洛谷 P2925 [USACO08DEC]干草出售Hay For Sale
    洛谷 P1616 疯狂的采药
    洛谷 P1086 花生采摘
    洛谷 P1048 采药
  • 原文地址:https://www.cnblogs.com/kaililikai/p/5918146.html
Copyright © 2011-2022 走看看