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 |
itoa不能用吗?为什么会CE?#include<string.h> #include<stdio.h> #include<stdlib.h> int t,n,s,p,l; char st[15]; int main() { scanf("%d",&t); while (t>0) { t--; scanf("%d",&n); p=0; s=0; while (n>0) { p++; itoa(p,st,10); l=strlen(st); s+=l; n-=s; } n+=s; p=0; s=0; while (n>0) { p++; itoa(p,st,10); l=strlen(st); n-=l; } n+=l; printf("%c\n",st[n-1]); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator