Uva 414 Machined Surfaces

原创 2012年03月29日 15:56:32
#include<stdio.h>
#include<string.h>
int main()
{
	int n,i,j,min,sum;
	int count[20];
	while(scanf("%d",&n),n)
	{
		char ch;
		sum = 0;
		memset(count,0,sizeof(count));
		for(i=0; i<n; i++)
		{
			for(j=0; j<26; j++)
			if((ch=getchar())==' ')
				count[i]++;
			sum += count[i];
			if(i==0) min = count[i];
			else if(count[i]<min) min = count[i];
		}
		printf("%d\n",sum-min*n);
	}
	return 0;
}
/*
4
XXXX                XXXXX
XXX               XXXXXXX
XXXXX                XXXX
XX                 XXXXXX
2
XXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXX              XX
0
*/


相关文章推荐

UVa - 414 - Machined Surfaces(AC)

An imaging device furnishes digital images of two machined surfaces that eventually will be assemble...

UVa 414 Machined Surfaces(机器加工的表面)

Machined Surfaces  An imaging device furnishes digital images of two machined surfaces that ev...

UVa 414 - Machined Surfaces

题目大意:有n行字符串,每行中间是空格,两边是字母X,把右边的整体往左边平移,直到某一行中间没有空格就计算此时整个平面里的空格数。 首先想到的思路就是:利用两个数组left,right分别记录每一行...
  • gneveek
  • gneveek
  • 2011年09月27日 08:06
  • 1038

uva414 Machined Surfaces

Machined Surfaces  An imaging device furnishes digital images of two machined surfaces ...

UVa 414 Machined Surfaces (water ver.)

414 - Machined Surfaces Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=co...

uva 414 - Machined Surfaces

An imaging device furnishes digital images of two machined surfaces that eventually will be assemble...

414 - Machined Surfaces

Machined Surfaces  An imaging device furnishes digital images of two machined surfaces th...

Volume 0. Getting Started 414 - Machined Surfaces

Machined Surfaces An imaging device furnishes digital images of two machined surfaces tha...
  • WHQ557
  • WHQ557
  • 2012年05月24日 23:14
  • 230

Machined Surfaces

An imaging device furnishes digital images of two machined surfaces that eventually will be assemble...

poj 1493 Machined Surfaces(最后有多少个空格)

D - Machined Surfaces Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submi...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Uva 414 Machined Surfaces
举报原因:
原因补充:

(最多只允许输入30个字)