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<iostream.h> #include<math.h> void main(){ char x[20][8],y[20][8]; int n,i,ax,ay; cin>>n; for(i=0;i<n;i++) cin>>x[i]>>y[i]; for(i=0;i<n;i++){ ax=abs(x[i][0]-y[i][0]); ay=abs(x[i][1]-y[i][1]); if(ax>ay) cout<<ax<<" "; else cout<<ay<<" "; if(ax==ay||ax==0||ay==0) cout<<"1 "; else cout<<abs(ax-ay)+1<<" "; if(ax==0||ay==0) cout<<"1 "; else cout<<"2 "; if(ax==ay) cout<<"1 "<<endl; else cout<<"Inf "<<endl; } } 提交市老是出错,是算法有问题吗?或是还有别的什么地方没有考虑到。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator