uva414

#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>


using namespace std;


char str[120];
int main(){
    #ifdef LOCAL
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    #endif
int n, count[15], maxs, sum;
while(scanf("%d", &n),n){
   memset(count, 0, sizeof(count));
   sum = 0;
   maxs = 0;
   getchar();
   for(int i = 0; i < n; i++){
       gets(str);
       //puts(str);
            for(int j = 0; j < strlen(str); j++){
                if(str[j] == 'X') count[i]+= 1;
            }
            if(count[i] > maxs) maxs = count[i];
   }
   for(int i = 0; i< n; i++){
            sum+=maxs - count[i];
   }
   printf("%d\n", sum);
}
return 0;
}
發佈了100 篇原創文章 · 獲贊 8 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章