ACM (TJU) : 2001



package volume_XI;

import java.util.Scanner;

public class Id_2001 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		Scanner input = new Scanner (System.in);
		
		int n = input.nextInt();
		int testCase = 0;
		
		while ( n != 0 ) {
			int m = input.nextInt();
			int count = 0;
			String s;
			
			while ( m != 0 ) {
				s = input.next();
				if ( s.equals("sheep"))
					count++;
				m--;
			}
			System.out.printf("Case %d: This list contains %d sheep.\n", ++testCase, count);
			if ( n != 1 )
				System.out.println ();
			n--;
		}
	}
}


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s