Skip to content

Instantly share code, notes, and snippets.

@binjoo
Created October 21, 2012 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save binjoo/3926319 to your computer and use it in GitHub Desktop.
Save binjoo/3926319 to your computer and use it in GitHub Desktop.
JAVA:英雄联盟语录
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class sdf {
public static void main(String[] args) {
String uri = "X:\\英雄联盟语录.txt";
try {
List<String> list = new ArrayList<String>();
File file = new File(uri);
FileInputStream fis = new FileInputStream(file);
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
String str = "";
while ((str = br.readLine()) != null) {
if (str.equals("")) {
continue;
}
list.add("#英雄联盟语录#" + str);
}
Collections.shuffle(list);
} catch (Exception e) {
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment