#include<iostream> using namespace std; int main(){ int N; int h1[1010]; int h2[1010]; while(cin>>N && N!=0){ int win=0,lose=0; for(int i=0;i<N;i++){ cin>>h1[i]; } for(int i=0;i<N;i++){ cin>>h2[i]; } for(int i=0;i<N;i++){ if(i==N-1){ if(h1[i]-h2[0]>0){ win++; } else if(h1[i]-h2[0]<0){ lose++; } } else{ if(h1[i]-h2[i+1]>0){ win++; } else if(h1[i]-h2[i+1]<0){ lose++; } } } cout<<win-lose<<endl; } } |
Double click to view unformatted code.