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 |
贴个代码~#include <stdio.h> #include <math.h> int main() { unsigned long n; while(scanf("%d",&n)!=EOF) { if(n<=9) { printf("Stan wins.\n"); continue; } while(1) { n=(unsigned long)ceil( (double)n/18 ); if(n<=9) break; } if(n<=1) printf("Ollie wins.\n"); else printf("Stan wins.\n"); } return 0; } 自己感觉比较简洁~O(∩_∩)O~ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator