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 |
比上面回的更精简!In Reply To:Re:怎么才能不超时???我已经很费力了!!! Posted by:jimmyzzxhlh1 at 2005-01-09 15:47:43 #include <stdio.h> int main() { int n,i,ways; scanf("%d",&n); ways = 0; if(n%2 != 0)ways++; for(i = 1;i < n;i = i + 2) { if(n%i == 0) ways++; } printf("%d\n",ways); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator