public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new FileReader("e.txt"));
String line = br.readLine();
int time = Integer.parseInt(line);
if (time > 0) {
System.out.println("您还有" + time-- + "次试用机会");
FileWriter fw = new FileWriter("e.txt");
fw.write(time + "");
fw.close();
}else{
System.out.println("您已经没有试用机会,请购买正版软件");
}
br.close();
}
}
|
|