Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
虽然是水题,代码也要精简,来个191B的小代码PRS三个字母换成2进制,取后三位刚好是023,以此为索引打表(3表示平局,2表示赢,1表示输) main() { char s[80], t[80], *p, *q, c, m[] = "3321333313322313"; int x[3]; while (gets(s) && *s != 69) { gets(t); p = s; q = t; *x = x[1] = 0; while (c = *p++)x[m[(c & 3) * 4 + (*q++ & 3)] - 49]++; printf("P1: %d\nP2: %d\n", x[1], *x); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator