数学推论题,有胜负场的话,总分加3,平局总分加2,所以:平局数=3*总场数-总分数

172k         0ms

code:

#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

int main()
{
  int team, n;
  char name[20];
  while(scanf("%d%d",&team, &n), team)
  {
    int sum=0, point, i=team;
    while(i--)
    {
      scanf("%s%d", name, &point);
      sum+=point;
    }
    printf("%d\n", 3*n-sum);
  }
  return 0;
}
 

posted on 2011-01-21 22:19  FreeAquar  阅读(115)  评论(0编辑  收藏  举报