Skip to content

Instantly share code, notes, and snippets.

@Jack-Saleem
Created July 17, 2016 13:53
Show Gist options
  • Save Jack-Saleem/4213846b08c1de54ca946f565da9ae11 to your computer and use it in GitHub Desktop.
Save Jack-Saleem/4213846b08c1de54ca946f565da9ae11 to your computer and use it in GitHub Desktop.
codeforces 100935C OCR program in java
import java.util.Scanner;
public class OCR
{
public static void main(String[] args)
{
Scanner z=new Scanner(System.in);
int n=z.nextInt();
int temp=0;
String op="";
int cnt=1;
while(true)
{
temp++;
int a=z.nextInt();
int b=z.nextInt();
String x="";
int y=0;
for(int i=0;i<a;i++){
x=z.next();
if(x.indexOf(".**")!=-1 && x.indexOf("**.")!=-1)
y++;
}
if(y==2)
op+="Case "+cnt+++": Zero\n";
else
op+="Case "+cnt+++": Eight\n";
if(temp==n)
break;
}
System.out.println(op);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment