作者:mobiledu2502872023 | 来源:互联网 | 2024-09-30 13:46
importjava.io.BufferedReader;importjava.io.File;importjava.io.FileReader;importjava.io.
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
class IO7 {public static void main(String[] args) {File file = new File("I:\\bb.txt");BufferedReader bufr = null;try {bufr = new BufferedReader(new FileReader(file));int ch = 0;int count = 0;while ((ch = bufr.read()) != -1) {
if (ch == 97 || ch == 65)count++;}System.out.println(count);} catch (IOException e) {e.printStackTrace();} finally {try {if (bufr != null) {bufr.close();}} catch (IOException e) {e.printStackTrace();}}}
}