#include
#include
#include
#include
#include
#pragma warning(disable:4996) using namespace std; int show[10] = { 6,2,5,5,4,5,6,3,7,6 }; int get(int a) { int sum = 0; if (a == 0) return 6; while (a) { sum += show[a % 10]; a /= 10; } return sum; } int main() { int a,b,c,statime,endtime,d,time,arr[100],count=1; char s[100],st[100]; while (~scanf("%s %d:%d:%d", s,&a,&b,&c)) { memset(arr, 0, sizeof(arr)); statime = a * 3600 + b * 60 + c; int num = 0; while (1) { scanf("%s %d:%d:%d", s, &a, &b, &c); if (strcmp(s, "END") == 0) { endtime = a * 3600 + b*60 + c; break; } scanf("%s %d", st, &d); time= a * 3600 + b*60 + c; num+= (get(arr[1]) + get(arr[0]))*(time - statime); statime = time; if (strcmp(st, "home") == 0) arr[0] += d; else arr[1] += d; } num+= (get(arr[1]) + get(arr[0]))*(endtime - statime); printf("Case %d: ", count++); printf("%d\n", num); } return 0; }
J - 超大型LED显示屏
最新推荐文章于 2024-08-14 13:53:45 发布