| ||||||||||
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 f(double k) { if(k-floor(k)<ceil(k)-k) return floor(k); else return ceil(k); } int getrounders(int m) { if(m/10==0) return m; else return 10*(getrounders(f(m/10.0))); } int main() { int n,s; scanf("%d",&n); while(n--) { scanf("%d",&s); printf("%d\n",getrounders(s)); } return 0; } 请高人指点指点 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator