|
|
back to boardWHY??? #include <iostream> using namespace std; int main() { long int a, i=0, n, k1=0, k2=0; cin>>n; while( i < n ) { cin>>a; if( k1 < k2 ) k1 += a; else k2 += a; i++; } if( k1 >= k2 ) cout<<k1-k2<<endl; else cout<<k2-k1<<endl; return 0; } |
|
|