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 |
发现一个神奇的问题,大家来看一下..VEEGIN同学的处理方式: for(i=1;i<n;i++) { scanf(" %c%d",&p1,&m); p1-=64; for(j=1;j<=m;j++) { scanf(" %c%d",&p2,&v); p2-=64; map[p1][p2]=map[p2][p1]=v; } } 我一开始的处理方式是 for(int i=0;i<n-1;++i) { scanf("%*c%c %d",&p,&num); for(int j=0;j<num;++j) { scanf(" %c %d",&dest,&length); node[c].pa=p-'A'; node[c].pb=dest-'A'; node[c].len=length; ++c; } } RE了,按我感觉%*c就是对应他上面的空格啊..为什么在这里会有区别呢.. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator