简单题啊: { Author:wzx961008 Problem:UVa 414-Machined Surfaces Verdict:Accepted Language:PASCAL Run Time:0.012s Submission Date:2011-01-15 00:37:07 } var n,i,j,min,ans:longint; a:array[1..13,1..25]of char; num:array[1..13]of longint; begin while true do begin readln(n); if n=0 then break; for i:=1 to n do begin for j:=1 to 25 do read(a[i,j]); readln end; min:=maxlongint; fillchar(num,sizeof(num),0); for i:=1 to n do begin for j:=1 to 25 do if a[i,j]=' ' then inc(num[i]); if num[i]<min then min:=num[i]; end; ans:=0; for i:=1 to n do begin num[i]:=num[i]-min; ans:=ans+num[i]; end; writeln(ans); end; end.