JAVA记事本的实验分析_java程序设计课程 大型实验 - 记事本

1:package j_201126100207;2:3:import java.awt.*;4:import java.awt.event.*;5:import static java.awt.event.InputEvent.*;6:import java.io.BufferedReader;7:import java.io.BufferedWriter;8:import java.io.File;9:import java.io.FileReader;10:import java.io.FileWriter;11:import java.io.IOException;12:import javax.swing.*;13:import javax.swing.event.*;14:import javax.swing.filechooser.FileFilter;15:16:public class J_201126100207 extends JFrame {17:18: public final static String imagePath = "image/";19: public final static Icon NEW24 = new ImageIcon(imagePath + "New24.gif", "new");20: public final static Icon OPEN24 = new ImageIcon(imagePath + "Open24.gif", "open");21: public final static Icon SAVE24 = new ImageIcon(imagePath + "Save24.gif", "save");22: //内部成员;23: private JFileChooser choose;24: private File selectedFile = null;25: private JTextArea textarea;26: private boolean newPage = false;27: private Font font;28://===========================================================================================================29:30: public J_201126100207(String title) {31: Container content = getContentPane();32: setTitle(title);33: super.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);34:35: JMenuBar mb = new JMenuBar();36: setJMenuBar(mb);37:38: //菜单栏标题及内容设置39: JMenu fileMenu = new JMenu("文件(F)");40: mb.add(fileMenu);41: fileMenu.setMnemonic('F');42: JMenu javaTest = new JMenu("Java上机题目");43: mb.add(javaTest);44: JMenu communication = new JMenu("通讯录(C)");45: mb.add(communication);46: communication.setMnemonic('C');47: JMenu help = new JMenu("帮助(H)");48: mb.add(help);49: help.setMnemonic('H');50: //文件一栏的菜单51: JMenuItem newItem = new JMenuItem("新建(N)");52: fileMenu.add(newItem);53: JMenuItem openItem = new JMenuItem("打开(O)...");54: fileMenu.add(openItem);55: JMenuItem saveItem = new JMenuItem("保存(S)");56: fileMenu.add(saveItem);57: fileMenu.addSeparator();58: JMenuItem fontColorItem = new JMenuItem("字体与颜色(F)...");59: fileMenu.add(fontColorItem);60: fileMenu.addSeparator();61: JMenuItem exitItem = new JMenuItem("退出(X)");62: fileMenu.add(exitItem);63: //Java上机题目一栏的菜单64: JMenuItem repreatItem = new JMenuItem("回文数(H)...");65: javaTest.add(repreatItem);66: JMenuItem translationItem = new JMenuItem("数字与英语互译(T)...");67: javaTest.add(translationItem);68: JMenuItem countItem = new JMenuItem("统计英文数据(C)...");69: javaTest.add(countItem);70: JMenuItem sumItem = new JMenuItem("文本文件求和(M)...");71: javaTest.add(sumItem);72: //通讯录一栏的菜单73: JMenuItem maintainItem = new JMenuItem("通讯维护(W)...");74: communication.add(maintainItem);75: communication.addSeparator();76: JMenuItem setupItem = new JMenuItem("通讯录存储文件设置(L)...");77: communication.add(setupItem);78: JMenuItem aboutItem = new JMenuItem("关于(G)...");79: help.add(aboutItem);80:81: //设置textArea:添加滚动条,设置默认字体,及背景颜色82: textarea = new JTextArea();83: JScrollPane scorl = new JScrollPane(textarea);84: content.add(scorl);85: //font= new Font("宋体", Font.PLAIN, 14);86: textarea.setFont(font);87: //toolbar组件定义88: JToolBar toolBar = new JToolBar();89: JButton newButton = new JButton(NEW24);90: newButton.setToolTipText("新建文件");91: JButton openButton = new JButton(OPEN24);92: openButton.setToolTipText("打开文件");93: JButton saveButton = new JButton(SAVE24);94: saveButton.setToolTipText("保存文件");95: toolBar.add(newButton);96: toolBar.add(openButton);97: toolBar.add(saveButton);98: toolBar.setFloatable(false);99:100: JPanel pane = new JPanel();101: BorderLayout bord = new BorderLayout();102: pane.setLayout(bord);103: pane.add("North", toolBar);104: pane.add("Center", scorl);105: content.add(pane);106: //快捷键设置107: newItem.setAccelerator(KeyStroke.getKeyStroke('N', CTRL_DOWN_MASK));108: openItem.setAccelerator(KeyStroke.getKeyStroke('O', CTRL_DOWN_MASK));109: saveItem.setAccelerator(KeyStroke.getKeyStroke('S', CTRL_DOWN_MASK));110: fontColorItem.setAccelerator(KeyStroke.getKeyStroke('F', CTRL_DOWN_MASK));111: exitItem.setAccelerator(KeyStroke.getKeyStroke('X', CTRL_DOWN_MASK));112: repreatItem.setAccelerator(KeyStroke.getKeyStroke('H', CTRL_DOWN_MASK));113: translationItem.setAccelerator(KeyStroke.getKeyStroke('T', CTRL_DOWN_MASK));114: countItem.setAccelerator(KeyStroke.getKeyStroke('C', CTRL_DOWN_MASK));115: sumItem.setAccelerator(KeyStroke.getKeyStroke('M', CTRL_DOWN_MASK));116: maintainItem.setAccelerator(KeyStroke.getKeyStroke('W', CTRL_DOWN_MASK));117: setupItem.setAccelerator(KeyStroke.getKeyStroke('L', CTRL_DOWN_MASK));118: aboutItem.setAccelerator(KeyStroke.getKeyStroke('G', CTRL_DOWN_MASK));119:120://===================================================================================================================121: //事件处理:122: //窗口关闭123: addWindowListener(new WindowAdapter() {124: @Override125: public void windowClosing(WindowEvent event) {126: if (selectedFile == null && textarea.getText().equals("")) {127: int retuenValue = JOptionPane.showConfirmDialog(null, " 确定要退出系统吗?", "是否退出", JOptionPane.YES_NO_OPTION);128: if (retuenValue == JOptionPane.YES_OPTION) {129: System.exit(0);130: }131: } else {132: int btn = JOptionPane.showConfirmDialog(null, "是否保存到"133: + selectedFile + "?", "是否保存",134: JOptionPane.YES_NO_CANCEL_OPTION);135: if (btn == JOptionPane.CANCEL_OPTION) {136: } else if (btn == JOptionPane.NO_OPTION) {137: System.exit(0);138: } else {139: if (selectedFile == null140: && !textarea.getText().equals("")) {141: choose = new JFileChooser();142: int state = choose.showSaveDialog(J_201126100207.this);143: if (state == JFileChooser.APPROVE_OPTION) {144: try {145: File file = choose.getSelectedFile();146: BufferedWriter bw = new BufferedWriter(147: new FileWriter(file));148: String str = textarea.getText();149: String[] lines = str.split("\n");150: for (String line : lines) {151: bw.write(line + "\r\n");152: }153: bw.flush();154: file.createNewFile();155: bw.close();156: } catch (IOException e) {157: JOptionPane.showConfirmDialog(null,158: "保存文件失败!", "ERROR",159: JOptionPane.ERROR_MESSAGE);160: }161: }162: System.exit(0);163: } else if (selectedFile != null) {164: try {165: BufferedWriter bw = new BufferedWriter(166: new FileWriter(selectedFile));167: String str = textarea.getText();168: String[] lines = str.split("\n");169: for (String line : lines) {170: bw.write(line + "\r\n");171: }172: bw.flush();173: bw.close();174: } catch (IOException e) {175: }176: System.exit(0);177: }178: }179: }180: }181: });182:183: //新建按钮184: newItem.addActionListener(new ActionListener() {185: @Override186: public void actionPerformed(ActionEvent e) {187: if (selectedFile == null && textarea.getText().equals("")) {188: return;189: } else {190: int btn = JOptionPane.showConfirmDialog(J_201126100207.this, "是否保存到...?", "是否保存", JOptionPane.YES_NO_CANCEL_OPTION);191: if (btn == JOptionPane.CANCEL_OPTION) {192: return;193: } else if (btn == JOptionPane.YES_OPTION) {194: if (!textarea.getText().equals("")) {195: JFileChooser choose = new JFileChooser();196: int state = choose.showSaveDialog(J_201126100207.this);197: if (state == JFileChooser.APPROVE_OPTION) {198: try {199: File file = choose.getSelectedFile();200: BufferedWriter bw = new BufferedWriter(new FileWriter(file));201: String str = textarea.getText();202: String[] lines = str.split("\n");203: for (String line : lines) {204: bw.write(line + "\r\n");205: }206: bw.flush();207: file.createNewFile();208: bw.close();209:210: } catch (IOException ex) {211: JOptionPane.showConfirmDialog(J_201126100207.this,212: "保存文件失败!", "ERROR",213: JOptionPane.ERROR_MESSAGE);214: }215: }216: }217: }218: }219: textarea.setText("");//清空textarea中的内容;220:221: }222: });223: newButton.addActionListener(new ActionListener() {224: @Override225: public void actionPerformed(ActionEvent e) {226: if (selectedFile == null && textarea.getText().equals("")) {227: return;228: } else {229: int btn = JOptionPane.showConfirmDialog(J_201126100207.this, "是否保存到...?", "是否保存", JOptionPane.YES_NO_CANCEL_OPTION);230: if (btn == JOptionPane.CANCEL_OPTION) {231: return;232: } else if (btn == JOptionPane.YES_OPTION) {233: if (!textarea.getText().equals("")) {234: choose = new JFileChooser();235: int state = choose.showSaveDialog(J_201126100207.this);236: if (state == JFileChooser.APPROVE_OPTION) {237: try {238: File file = choose.getSelectedFile();239: BufferedWriter bw = new BufferedWriter(new FileWriter(file));240: String str = textarea.getText();241: String[] lines = str.split("\n");242: for (String line : lines) {243: bw.write(line + "\r\n");244: }245: bw.flush();246: file.createNewFile();247: bw.close();248: } catch (IOException ex) {249: JOptionPane.showConfirmDialog(J_201126100207.this,250: "保存文件失败!", "ERROR",251: JOptionPane.ERROR_MESSAGE);252: }253: }254: }255: }256: }257: textarea.setText("");//清空textarea中的内容;258: }259: });260:261:262: //打开按钮263: openItem.addActionListener(new ActionListener() {264: @Override265: public void actionPerformed(ActionEvent e) {266: if (selectedFile == null && textarea.getText().equals("")) {267: } else {268: int btn = JOptionPane.showConfirmDialog(J_201126100207.this,269: "是否保存到...?", "是否保存",270: JOptionPane.YES_NO_CANCEL_OPTION);271: if (btn == JOptionPane.CANCEL_OPTION) {272: return;273: } else if (btn == JOptionPane.YES_OPTION) {274: }275: }276: choose = new JFileChooser();277: choose.addChoosableFileFilter(new fileFilter("java"));278: choose.addChoosableFileFilter(new fileFilter("txt"));279: choose.addChoosableFileFilter(new fileFilter("cpp"));280: int state = choose.showOpenDialog(J_201126100207.this);281: if (state == JFileChooser.APPROVE_OPTION) {282: try {283: selectedFile = choose.getSelectedFile();284: BufferedReader br = new BufferedReader(new FileReader(selectedFile));285: textarea.read(br, "");286: br.close();287: } catch (IOException ex) {288: JOptionPane.showConfirmDialog(J_201126100207.this,289: "打开文件失败", "error",290: JOptionPane.ERROR_MESSAGE);291: }292: }293: }294: });295:296: //打开图标297: openButton.addActionListener(new ActionListener() {298: @Override299: public void actionPerformed(ActionEvent e) {300: if (selectedFile == null && textarea.getText().equals("")) {301: } else {302: int btn = JOptionPane.showConfirmDialog(J_201126100207.this,303: "是否保存到...?", "是否保存",304: JOptionPane.YES_NO_CANCEL_OPTION);305: if (btn == JOptionPane.CANCEL_OPTION) {306: return;307: } else if (btn == JOptionPane.YES_OPTION) {308: }309: }310: choose = new JFileChooser();311: choose.addChoosableFileFilter(new fileFilter("java"));312: choose.addChoosableFileFilter(new fileFilter("txt"));313: choose.addChoosableFileFilter(new fileFilter("cpp"));314: int state = choose.showOpenDialog(J_201126100207.this);315: if (state == JFileChooser.APPROVE_OPTION) {316: try {317: selectedFile = choose.getSelectedFile();318: BufferedReader br = new BufferedReader(new FileReader(selectedFile));319: textarea.read(br, "");320: br.close();321: } catch (IOException ex) {322: JOptionPane.showConfirmDialog(J_201126100207.this,323: "打开文件失败", "error",324: JOptionPane.ERROR_MESSAGE);325: }326: }327: }328: });329:330: //保存按钮331: saveItem.addActionListener(new ActionListener() {332: @Override333: public void actionPerformed(ActionEvent event) {334: if (newPage == true || selectedFile == null) {335: choose = new JFileChooser();336: int state = choose.showSaveDialog(J_201126100207.this);337: if (state == JFileChooser.APPROVE_OPTION) {338: try {339: File file = choose.getSelectedFile();340: BufferedWriter bw = new BufferedWriter(341: new FileWriter(file));342: String str = textarea.getText();343: String[] lines = str.split("\n");344: for (String line : lines) {345: bw.write(line + "\r\n");346: }347: bw.flush();348: file.createNewFile();349: bw.close();350: newPage = false;351: selectedFile = file;352: } catch (IOException e) {353: JOptionPane.showMessageDialog(J_201126100207.this, "保存文件失败",354: "ERROR", JOptionPane.ERROR_MESSAGE);355: }356: }357: } else if (newPage == false && selectedFile != null) {358:359: try {360: BufferedWriter bw = new BufferedWriter(new FileWriter(361: selectedFile));362: String str = textarea.getText();363: String[] lines = str.split("\n");364: for (String line : lines) {365: bw.write(line + "\r\n");366: }367: bw.flush();368: bw.close();369: newPage = false;370: } catch (IOException e) {371: JOptionPane.showMessageDialog(J_201126100207.this, "保存文件失败",372: "ERROR", JOptionPane.ERROR_MESSAGE);373: }374: }375: }376: });377: //保存图标378: saveButton.addActionListener(new ActionListener() {379: @Override380: public void actionPerformed(ActionEvent event) {381: if (newPage == true || selectedFile == null) {382: choose = new JFileChooser();383: int state = choose.showSaveDialog(J_201126100207.this);384: if (state == JFileChooser.APPROVE_OPTION) {385: try {386: File file = choose.getSelectedFile();387: BufferedWriter bw = new BufferedWriter(388: new FileWriter(file));389: String str = textarea.getText();390: String[] lines = str.split("\n");391: for (String line : lines) {392: bw.write(line + "\r\n");393: }394: bw.flush();395: file.createNewFile();396: bw.close();397: newPage = false;398: selectedFile = file;399: } catch (IOException e) {400: JOptionPane.showMessageDialog(J_201126100207.this, "保存文件失败",401: "ERROR", JOptionPane.ERROR_MESSAGE);402: }403: }404: } else if (newPage == false && selectedFile != null) {405:406: try {407: BufferedWriter bw = new BufferedWriter(new FileWriter(408: selectedFile));409: String str = textarea.getText();410: String[] lines = str.split("\n");411: for (String line : lines) {412: bw.write(line + "\r\n");413: }414: bw.flush();415: bw.close();416: newPage = false;417: } catch (IOException e) {418: JOptionPane.showMessageDialog(J_201126100207.this, "保存文件失败",419: "ERROR", JOptionPane.ERROR_MESSAGE);420: }421: }422: }423: });424: //字体颜色设置425: fontColorItem.addActionListener(new ActionListener() {426: @Override427: public void actionPerformed(ActionEvent e) {428: FontDialog fontdialog = new FontDialog(J_201126100207.this);429:430:431: }432: });433:434: exitItem.addActionListener(new ActionListener() {435: @Override436: public void actionPerformed(ActionEvent event) {437: if (selectedFile == null && textarea.getText().equals("")) {438: int retuenValue = JOptionPane.showConfirmDialog(null, " 确定要退出系统吗?", "是否退出", JOptionPane.YES_NO_OPTION);439: if (retuenValue == JOptionPane.YES_OPTION) {440: System.exit(0);441: }442: } else {443: int btn = JOptionPane.showConfirmDialog(null, "是否保存到"444: + selectedFile + "?", "是否保存",445: JOptionPane.YES_NO_CANCEL_OPTION);446: if (btn == JOptionPane.CANCEL_OPTION) {447: return;448: } else if (btn == JOptionPane.NO_OPTION) {449: System.exit(0);450: } else {451: if (selectedFile == null452: && !textarea.getText().equals("")) {453: choose = new JFileChooser();454: int state = choose.showSaveDialog(J_201126100207.this);455: if (state == JFileChooser.APPROVE_OPTION) {456: try {457: File file = choose.getSelectedFile();458: BufferedWriter bw = new BufferedWriter(459: new FileWriter(file));460: String str = textarea.getText();461: String[] lines = str.split("\n");462: for (String line : lines) {463: bw.write(line + "\r\n");464: }465: bw.flush();466: file.createNewFile();467: bw.close();468: } catch (IOException e) {469: JOptionPane.showConfirmDialog(null,470: "保存文件失败!", "ERROR",471: JOptionPane.ERROR_MESSAGE);472: }473: }474: System.exit(0);475: } else if (selectedFile != null) {476: try {477: BufferedWriter bw = new BufferedWriter(478: new FileWriter(selectedFile));479: String str = textarea.getText();480: String[] lines = str.split("\n");481: for (String line : lines) {482: bw.write(line + "\r\n");483: }484: bw.flush();485: bw.close();486: } catch (IOException e) {487: }488: System.exit(0);489: }490: }491: }492: }493: });494:495: repreatItem.addActionListener(new ActionListener() {496: @Override497: public void actionPerformed(ActionEvent event) {498: repreatDialog repreat = new repreatDialog(J_201126100207.this);499: }500: });501:502: translationItem.addActionListener(new ActionListener() {503: @Override504: public void actionPerformed(ActionEvent event) {505: translateDialog translation = new translateDialog(J_201126100207.this);506: }507: });508:509:510: countItem.addActionListener(new ActionListener() {511: @Override512: public void actionPerformed(ActionEvent event) {513: countDialog CountDialog = new countDialog(J_201126100207.this);514:515: }516: });517:518: sumItem.addActionListener(new ActionListener() {519: @Override520: public void actionPerformed(ActionEvent event) {521: sumDialog sum = new sumDialog(J_201126100207.this);522: }523: });524:525: //关于按钮526: aboutItem.addActionListener(new ActionListener() {527: @Override528: public void actionPerformed(ActionEvent e) {529: JOptionPane.showMessageDialog(J_201126100207.this, "Java记事本" + "\n"530: + "designed by 姜楠\n" + " in ZJUT", "关于",531: JOptionPane.INFORMATION_MESSAGE);532: }533: });534:535: }536://================================================================================================================537:538: /**539:* 内部类定义以及实现540:*/541: private class FontDialog extends JDialog implements ActionListener, ItemListener {542:543: private JButton fontColorButton;544: private JButton backGroundButton;545: private JButton okButton;546: private JButton cancelButton;547: private String fontName;548: private int fontSize;549: private Font font;550: private JComboBox nameCombo;551: private JComboBox sizeCombo;552: private JLabel fontDisplay;553:554: public FontDialog(J_201126100207 window) {555: GridLayout grid = new GridLayout(6, 2);556: setLayout(grid);557: setModal(true);558: setTitle("设置颜色与字体");559:560: font = textarea.getFont();561: fontName = font.getFontName();562: fontSize = font.getSize();563:564: //获取所有的字体565: GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();566: String[] fontNames = ge.getAvailableFontFamilyNames();567: nameCombo = new JComboBox(fontNames);568: nameCombo.addItemListener(this);569:570: //创建和添加组件到FontDialog571: JLabel nameLabel = new JLabel("字体名称");572: add(nameLabel);573: add(nameCombo);574:575: JLabel sizeLabel = new JLabel("字体大小");576: String[] size = {"8", "10", "12", "14", "16", "18", "20", "22", "24", "26", "28", "30", "32", "34", "42", "52", "62", "72"};577: sizeCombo = new JComboBox(size);578: sizeCombo.addItemListener(this);579: add(sizeLabel);580: add(sizeCombo);581:582: JLabel fontLabel = new JLabel("字体颜色");583: fontColorButton = new JButton("设置...");584: fontColorButton.addActionListener(this);585: add(fontLabel);586: add(fontColorButton);587: JLabel backGroundLabel = new JLabel("背景颜色");588: backGroundButton = new JButton("设置...");589: backGroundButton.addActionListener(this);590: add(backGroundLabel);591: add(backGroundButton);592: JLabel displayLabel = new JLabel("字体预览");593: fontDisplay = new JLabel("Java 字体预览");594: fontDisplay.setFont(font);595: JPanel displayPanel = new JPanel(true);596: displayPanel.setBackground(Color.WHITE);597: displayPanel.add(fontDisplay);598: add(displayLabel);599:600: add(displayPanel);601: okButton = new JButton("确定");602: okButton.addActionListener(this);603: cancelButton = new JButton("取消");604: cancelButton.addActionListener(this);605: add(okButton);606: add(cancelButton);607: setSize(600, 300);608: setLocationRelativeTo(window);609: setVisible(true);610: }611:612: @Override613: public void itemStateChanged(ItemEvent e) {614: if (e.getStateChange() == ItemEvent.SELECTED) {615: if (e.getSource() == nameCombo) {616: fontName = (String) nameCombo.getSelectedItem();617: } else if (e.getSource() == sizeCombo) {618: fontSize = Integer.parseInt(sizeCombo.getSelectedItem().toString());619: }620: font = new Font(fontName, font.PLAIN, fontSize);621: fontDisplay.setFont(font);622: fontDisplay.repaint();623: }624: }625:626: @Override627: public void actionPerformed(ActionEvent e) {628: if (e.getSource() == fontColorButton) {629: Color color = JColorChooser.showDialog(null, "选择字体颜色", getBackground());630: textarea.setForeground(color);631: } else if (e.getSource() == backGroundButton) {632: Color color = JColorChooser.showDialog(null, "选择背景颜色", getBackground());633: textarea.setForeground(color);634: } else if (e.getSource() == okButton) {635: textarea.setFont(font); // Set the selected font636: setVisible(false);637: } else if (e.getSource() == cancelButton) {638: setVisible(false);639: }640: }641: }642:643://================================================================================================================644: private class fileFilter extends FileFilter {645:646: String ext;647:648: public fileFilter(String ext) {649: this.ext = ext;650: }651:652: @Override653: public boolean accept(File file) {654: String name = file.getName().toLowerCase();655: if (name.endsWith(ext) || file.isDirectory()) {656: return true;657: } else {658: return false;659: }660: }661:662: @Override663: public String getDescription() {664: if (ext.equals("java")) {665: return "*.java";666: } else if (ext.equals("txt")) {667: return "*.txt";668: } else if (ext.equals("cpp")) {669: return "*.cpp";670: }671: return "";672: }673: }674://================================================================================================================675:676: private class countDialog extends JDialog implements ActionListener {677:678: JLabel label1, label2, label3;679: JTextField textField1, textField2, textField3;680: JButton okButton;681: JButton cancelButton;682:683: public countDialog(J_201126100207 window) {684: GridLayout grid = new GridLayout(4, 2);685: setLayout(grid);686: setModal(true);687: setTitle("统计英文数据");688:689: label1 = new JLabel("以字母w 开头的单词数");690: add(label1);691: textField1 = new JTextField();692: textField1.setEditable(false);693: add(textField1);694: label2 = new JLabel("含'or'字符串的单词数");695: add(label2);696: textField2 = new JTextField();697: textField2.setEditable(false);698: add(textField2);699: label3 = new JLabel("长度为 3 的单词数");700: add(label3);701: textField3 = new JTextField();702: textField3.setEditable(false);703: add(textField3);704: JPanel okPanel = new JPanel();705: okButton = new JButton("确定");706: okPanel.add(okButton);707: okButton.addActionListener(this);708: this.add(okPanel);709: JPanel cancelPanel = new JPanel();710: cancelButton = new JButton("退出");711: cancelPanel.add(cancelButton);712: cancelButton.addActionListener(this);713: this.add(cancelPanel);714:715: int beginWithW = 0, includeOr = 0, lengthEqualToThree = 0;716: String str = textarea.getText();717: if (!str.equals("")) {718: String[] lines = str.split("\n");719: if (!lines.equals("")) {720: for (String line : lines) {721: String t[] = line.split(" ");722: for (String temp : t) {723: if (temp.charAt(0) == 'W' || temp.charAt(0) == 'w') {724: beginWithW++;725: }726: if (temp.indexOf("or") != -1) {727: includeOr++;728: }729: if (temp.length() == 3) {730: lengthEqualToThree++;731: }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值