POJ 1493 Machined Surfaces G++

#include <iostream>
#include <string>
using namespace std;
//谢谢博友文章 
int main()
{
	while(1)
	{
		int NUM;
		cin>>NUM;
		if(NUM==0)
		{
			break;
		}
		string t;
		getline(cin,t);		
		int zd=0;
		int he=0;
		for(int i=0;i<NUM;i++)
		{
			string a;
			getline(cin,a);
			int js=0;
			for(int j=0;j<25;j++)
			{
				if(a[j]=='X')
				{
					js++;
				}
			}
			if(js>zd)
			{
				zd=js;
			}
			he=he+js;
		}
		cout<<zd*NUM-he<<endl;
	}
	return 0;
} 


猜你喜欢

转载自blog.csdn.net/woniupengpeng/article/details/78803603
g++