Created
February 25, 2014 08:03
-
-
Save rayjcwu/9204785 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Solution { | |
| public static void main(String []argv) { | |
| BufferedReader br = new BufferedReader(new FileReader("....")); | |
| boolean prevHasError = false; | |
| int lineNum = 0; | |
| while (br.hasNext()) { | |
| String line = br.readLine(); | |
| boolean hasError = (line.indexOf("error") != -1); | |
| if (hasError || prevHasError) { | |
| System.out.println(lineNum + " " + line); | |
| } | |
| prevHasError = hasError; | |
| lineNum++; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment