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> //#include<algorithm> using namespace std; int n,k,m; int a[31]; int b[31]; int main() { int i; cin>>n>>m>>k; for(i = 0;i < k;i++) cin>>a[i]; for(i = 0;i < k;i++) cin>>b[i]; //sort(a,a+n); //sort(b,b+n); int sum = 0; for(i = 0;i < k;i++) { int t = (a[i]-b[i]); if(t < 0) t = -t; sum += t; } cout<<sum/2<<endl; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator