亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? module3.lst

?? Mcgraw-Hill - Java 2 - A Beginner S Guide, 2Nd Ed - 2003 -prog.
?? LST
?? 第 1 頁 / 共 2 頁
字號:
class DWDemo {   
  public static void main(String args[])   
    throws java.io.IOException { 
 
    char ch; 
 
    do { 
      System.out.print("Press a key following by ENTER: "); 
      ch = (char) System.in.read(); // get a char 
    } while(ch != 'q'); 
  }   
}

listing 23
// Guess the letter game, 4rd version.  
class Guess4 {   
  public static void main(String args[])   
    throws java.io.IOException { 
 
    char ch, answer = 'K'; 
 
    do { 
      System.out.println("I'm thinking of a letter between A and Z."); 
      System.out.print("Can you guess it: "); 
 
      // read a letter, but skip cr/lf 
      do { 
        ch = (char) System.in.read(); // get a char 
      } while(ch == '\n' | ch == '\r'); 
      
      if(ch == answer) System.out.println("** Right **"); 
      else { 
        System.out.print("...Sorry, you're "); 
        if(ch < answer) System.out.println("too low"); 
        else System.out.println("too high"); 
        System.out.println("Try again!\n"); 
      } 
    } while(answer != ch); 
  }   
}

listing 24
/* 
   Project 3-2 
 
   An improved Help system that uses a 
   a do-while to process a menu selection. 
*/ 
class Help2 { 
  public static void main(String args[])  
    throws java.io.IOException { 
    char choice; 
 
    do { 
      System.out.println("Help on:"); 
      System.out.println("  1. if"); 
      System.out.println("  2. switch"); 
      System.out.println("  3. for"); 
      System.out.println("  4. while"); 
      System.out.println("  5. do-while\n"); 
      System.out.print("Choose one: "); 
      do { 
        choice = (char) System.in.read(); 
      } while(choice == '\n' | choice == '\r');     
    } while( choice < '1' | choice > '5'); 
 
    System.out.println("\n"); 
  
    switch(choice) { 
      case '1': 
        System.out.println("The if:\n"); 
        System.out.println("if(condition) statement;"); 
        System.out.println("else statement;"); 
        break; 
      case '2': 
        System.out.println("The switch:\n"); 
        System.out.println("switch(expression) {"); 
        System.out.println("  case constant:"); 
        System.out.println("    statement sequence"); 
        System.out.println("    break;"); 
        System.out.println("  // ..."); 
        System.out.println("}"); 
        break; 
      case '3': 
        System.out.println("The for:\n"); 
        System.out.print("for(init; condition; iteration)"); 
        System.out.println(" statement;"); 
        break; 
      case '4': 
        System.out.println("The while:\n"); 
        System.out.println("while(condition) statement;"); 
        break; 
      case '5': 
        System.out.println("The do-while:\n"); 
        System.out.println("do {"); 
        System.out.println("  statement;"); 
        System.out.println("} while (condition);"); 
        break; 
    } 
  } 
}

listing 25
// Using break to exit a loop.   
class BreakDemo {  
  public static void main(String args[]) {  
    int num; 
 
    num = 100; 
 
    // loop while i-squared is less than num 
    for(int i=0; i < num; i++) {  
      if(i*i >= num) break; // terminate loop if i*i >= 100  
      System.out.print(i + " ");  
    }  
    System.out.println("Loop complete.");  
  }  
}

listing 26
// Read input until a q is received. 
class Break2 {   
  public static void main(String args[])   
    throws java.io.IOException { 
 
    char ch; 
 
    for( ; ; ) { 
      ch = (char) System.in.read(); // get a char 
      if(ch == 'q') break; 
    } 
    System.out.println("You pressed q!"); 
  }   
}

listing 27
// Using break with nested loops.  
class Break3 {  
  public static void main(String args[]) {  
  
    for(int i=0; i<3; i++) {  
      System.out.println("Outer loop count: " + i);  
      System.out.print("    Inner loop count: "); 
 
      int t = 0;             
      while(t < 100) {  
        if(t == 10) break; // terminate loop if t is 10  
        System.out.print(t + " ");  
        t++; 
      }  
      System.out.println();  
    }  
    System.out.println("Loops complete.");  
  }  
}

listing 28
// Using break with a  label. 
class Break4 {  
  public static void main(String args[]) {  
    int i; 
     
    for(i=1; i<4; i++) { 
one:  { 
two:    { 
three:    { 
            System.out.println("\ni is " + i); 
            if(i==1) break one; 
            if(i==2) break two; 
            if(i==3) break three; 
              
            // this is never reached 
            System.out.println("won't print"); 
          } 
          System.out.println("After block three."); 
        } 
        System.out.println("After block two."); 
      } 
      System.out.println("After block one."); 
    } 
    System.out.println("After for."); 
   
  }  
}

listing 29
// Another example of using break with a label. 
class Break5 {  
  public static void main(String args[]) {  
 
done: 
    for(int i=0; i<10; i++) { 
      for(int j=0; j<10; j++) { 
        for(int k=0; k<10; k++) { 
          System.out.println(k + " "); 
          if(k == 5) break done; // jump to done 
        } 
        System.out.println("After k loop"); // won't execute 
      } 
      System.out.println("After j loop"); // won't execute 
    } 
    System.out.println("After i loop");  
  }  
}

listing 30
// Where you put a label is important. 
class Break6 {  
  public static void main(String args[]) {  
    int x=0, y=0; 
 
// here, put label before for statement. 
stop1: for(x=0; x < 5; x++) { 
         for(y = 0; y < 5; y++) { 
           if(y == 2) break stop1; 
           System.out.println("x and y: " + x + " " + y);  
         } 
       } 
 
       System.out.println(); 
 
// now, put label immediately before { 
      for(x=0; x < 5; x++) 
stop2: { 
         for(y = 0; y < 5; y++) { 
           if(y == 2) break stop2; 
           System.out.println("x and y: " + x + " " + y);  
         } 
       } 
 
  }  
}

listing 31
// This program contains an error. 
class BreakErr { 
  public static void main(String args[]) { 
 
    one: for(int i=0; i<3; i++) { 
      System.out.print("Pass " + i + ": "); 
    } 
 
    for(int j=0; j<100; j++) { 
      if(j == 10) break one; // WRONG 
      System.out.print(j + " "); 
    } 
  } 
}

listing 32
// Use continue. 
class ContDemo {   
  public static void main(String args[]) { 
    int i; 
 
    // print even number between 0 and 100 
    for(i = 0; i<=100; i++) {  
      if((i%2) != 0) continue; // iterate 
      System.out.println(i); 
    } 
  }   
}

listing 33
// Use continue with a label. 
class ContToLabel {   
  public static void main(String args[]) { 
 
outerloop: 
    for(int i=1; i < 10; i++) { 
      System.out.print("\nOuter loop pass " + i + 
                       ", Inner loop: "); 
      for(int j = 1; j < 10; j++) { 
        if(j == 5) continue outerloop; // continue outer loop 
        System.out.print(j); 
      } 
    } 
  }   
}

listing 34
/* 
   Project 3-3 
 
   The finished Java statement Help system  
   that process multiple requests. 
*/ 
class Help3 { 
  public static void main(String args[])  
    throws java.io.IOException { 
    char choice; 
 
    for(;;) { 
      do { 
        System.out.println("Help on:"); 
        System.out.println("  1. if"); 
        System.out.println("  2. switch"); 
        System.out.println("  3. for"); 
        System.out.println("  4. while"); 
        System.out.println("  5. do-while"); 
        System.out.println("  6. break"); 
        System.out.println("  7. continue\n"); 
        System.out.print("Choose one (q to quit): "); 
        do { 
          choice = (char) System.in.read(); 
        } while(choice == '\n' | choice == '\r');     
      } while( choice < '1' | choice > '7' & choice != 'q'); 
 
      if(choice == 'q') break; 
 
      System.out.println("\n"); 
  
      switch(choice) { 
        case '1': 
          System.out.println("The if:\n"); 
          System.out.println("if(condition) statement;"); 
          System.out.println("else statement;"); 
          break; 
        case '2': 
          System.out.println("The switch:\n"); 
          System.out.println("switch(expression) {"); 
          System.out.println("  case constant:"); 
          System.out.println("    statement sequence"); 
          System.out.println("    break;"); 
          System.out.println("  // ..."); 
          System.out.println("}"); 
          break; 
        case '3': 
          System.out.println("The for:\n"); 
          System.out.print("for(init; condition; iteration)"); 
          System.out.println(" statement;"); 
          break; 
        case '4': 
          System.out.println("The while:\n"); 
          System.out.println("while(condition) statement;"); 
          break; 
        case '5': 
          System.out.println("The do-while:\n"); 
          System.out.println("do {"); 
          System.out.println("  statement;"); 
          System.out.println("} while (condition);"); 
          break; 
        case '6': 
          System.out.println("The break:\n"); 
          System.out.println("break; or break label;"); 
          break; 
        case '7': 
          System.out.println("The continue:\n"); 
          System.out.println("continue; or continue label;"); 
          break; 
      } 
      System.out.println(); 
    } 
  } 
}

listing 35
/*  
   Use nested loops to find factors of numbers 
   between 2 and 100. 
*/ 
class FindFac {   
  public static void main(String args[]) { 
 
    for(int i=2; i <= 100; i++) { 
      System.out.print("Factors of " + i + ": "); 
      for(int j = 2; j < i; j++) 
        if((i%j) == 0) System.out.print(j + " "); 
      System.out.println(); 
    } 
  }   
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区二区电影| 日韩一区和二区| 青青草97国产精品免费观看| 国产欧美一区二区精品仙草咪| 色婷婷综合久色| 国产精品白丝av| 免费成人av在线| 亚洲精品乱码久久久久久| 26uuu欧美| 欧美美女直播网站| 色综合天天综合在线视频| 国产一区二区三区久久久| 肉色丝袜一区二区| 亚洲欧美日韩在线| 国产午夜精品美女毛片视频| 欧美福利一区二区| 在线观看国产日韩| 99精品视频在线观看| 国产成人精品亚洲日本在线桃色| 奇米综合一区二区三区精品视频| 亚洲大片精品永久免费| 一区二区中文字幕在线| 国产丝袜欧美中文另类| 精品国产乱码91久久久久久网站| 欧美日韩国产一级片| 色天使色偷偷av一区二区| av亚洲精华国产精华精华| 国产91精品在线观看| 国产一区二区三区在线观看免费视频 | 一个色综合av| 最新国产精品久久精品| 中文字幕二三区不卡| 久久久国产一区二区三区四区小说| 日韩免费在线观看| 欧美一区二区在线免费播放| 欧美人动与zoxxxx乱| 欧美日韩mp4| 91精品啪在线观看国产60岁| 欧美日韩成人在线| 欧美电影一区二区| 在线播放亚洲一区| 6080yy午夜一二三区久久| 在线不卡a资源高清| 欧美一级黄色录像| 日韩精品一区二区三区三区免费 | 日韩理论片中文av| 亚洲欧洲成人自拍| 亚洲欧美成aⅴ人在线观看| 日韩伦理免费电影| 亚洲小说春色综合另类电影| 亚洲国产精品天堂| 奇米色777欧美一区二区| 蜜臀精品久久久久久蜜臀| 视频在线观看一区| 久久激情五月激情| 国产91精品在线观看| 91小视频在线观看| 91成人免费网站| 欧美一级专区免费大片| 精品国产91久久久久久久妲己 | 亚洲女同一区二区| 亚洲五码中文字幕| 久久精品国产成人一区二区三区| 精品一区二区在线视频| 国产不卡在线一区| 日本韩国欧美一区二区三区| 欧美日韩在线播放三区四区| 日韩午夜小视频| 国产亚洲精品aa| 玉米视频成人免费看| 强制捆绑调教一区二区| 高潮精品一区videoshd| 91久久人澡人人添人人爽欧美 | 亚洲女与黑人做爰| 首页欧美精品中文字幕| 国产精品一二一区| 欧美综合久久久| 欧美成人a在线| 中文字幕一区二区三区色视频| 亚洲一二三四久久| 国产一区二区看久久| 色一区在线观看| 精品国产一区二区亚洲人成毛片| 中文字幕在线不卡一区| 五月开心婷婷久久| 成人黄色大片在线观看| 91.com在线观看| 亚洲天堂免费看| 久久99精品久久久| 色丁香久综合在线久综合在线观看| 欧美电影免费观看高清完整版| 中文字幕日韩一区二区| 麻豆国产欧美日韩综合精品二区| av资源站一区| 久久久噜噜噜久久人人看| 亚洲国产日韩a在线播放性色| 国产成人日日夜夜| 欧美一区二区国产| 一区二区三区在线视频观看| 国产精品一区不卡| 91精品国产色综合久久不卡蜜臀 | 蜜臀精品一区二区三区在线观看| 99精品欧美一区二区蜜桃免费| 日韩免费视频线观看| 亚洲综合自拍偷拍| a在线欧美一区| 久久这里只有精品视频网| 亚洲福利视频三区| 色综合久久综合网97色综合| 久久久精品一品道一区| 麻豆精品久久久| 欧美日韩精品一区二区天天拍小说 | 国产精品自拍av| 日韩一区二区三区四区| 亚洲成人av福利| 日本伦理一区二区| 日韩美女啊v在线免费观看| 国产精品影视网| 精品国产sm最大网站免费看| 奇米精品一区二区三区在线观看一| 在线观看免费一区| 一区二区三区在线不卡| 91美女福利视频| 日韩理论片在线| 91丨porny丨首页| 最新不卡av在线| 91美女视频网站| 亚洲精品五月天| 一本一道综合狠狠老| 国产精品对白交换视频 | 久久se精品一区二区| 欧美久久一区二区| 五月开心婷婷久久| 3d动漫精品啪啪1区2区免费| 日韩国产成人精品| 欧美一级理论片| 捆绑变态av一区二区三区| 日韩欧美在线一区二区三区| 美女视频一区二区| 精品99一区二区三区| 国产麻豆成人精品| 亚洲国产精品二十页| av不卡一区二区三区| 亚洲天堂中文字幕| 欧美性色aⅴ视频一区日韩精品| 一区二区三区鲁丝不卡| 欧美日韩一区二区三区高清| 热久久国产精品| 精品国产乱码久久久久久浪潮 | 日本va欧美va欧美va精品| 91精品国产一区二区人妖| 精品亚洲国内自在自线福利| 久久夜色精品一区| 成人高清免费观看| 亚洲一区二区三区小说| 欧美精品丝袜中出| 狠狠狠色丁香婷婷综合激情| 国产精品网站一区| 在线亚洲+欧美+日本专区| 日韩成人一级大片| 久久久久久电影| 一本大道综合伊人精品热热| 午夜视频一区二区三区| 欧美大度的电影原声| 成人99免费视频| 亚洲高清在线视频| 久久久亚洲综合| 在线免费亚洲电影| 久久精品国产精品青草| 中文字幕亚洲区| 欧美人伦禁忌dvd放荡欲情| 国产尤物一区二区在线| 亚洲美女视频在线| 日韩一区二区免费在线观看| 成人网在线播放| 午夜视频久久久久久| 国产清纯美女被跳蛋高潮一区二区久久w| 93久久精品日日躁夜夜躁欧美| 日韩激情中文字幕| 国产精品乱人伦中文| 欧美一区二区在线免费播放| 成人激情开心网| 蜜臀av性久久久久蜜臀aⅴ| 国产精品久99| 日韩欧美不卡在线观看视频| av一区二区三区四区| 久久国产精品色婷婷| 亚洲日本护士毛茸茸| 精品国产乱码久久久久久蜜臀| 色偷偷一区二区三区| 国产成人在线影院| 日韩成人一级大片| 亚洲品质自拍视频网站| 精品国产一区二区三区四区四| 色8久久精品久久久久久蜜| 国产精品18久久久久久久久久久久 | 成人动漫一区二区| 麻豆久久久久久| 亚洲国产精品影院| 亚洲三级小视频|