Created
April 26, 2013 18:20
-
-
Save Dav1dde/5469294 to your computer and use it in GitHub Desktop.
This file contains 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
import java.util.Scanner; | |
public class AsciiShop01 { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int last_length = -1; | |
int overall = 0; | |
for(;scanner.hasNextLine();overall++) { | |
String line = scanner.nextLine(); | |
if(last_length == -1) | |
last_length = line.length(); | |
else if(last_length != line.length()) { | |
System.out.println("INPUT MISMATCH"); | |
return; | |
} | |
} | |
System.out.printf("%d %d\n", last_length, overall); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment