Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int num;
- cin >> num;
- int number;
- int leftSum = 0;
- int rightSum = 0;
- for (int i = 0; i < num; i++)
- {
- cin >> number;
- leftSum += number;
- }
- for (int i = 0; i < num; i++)
- {
- cin >> number;
- rightSum += number;
- }
- if (leftSum == rightSum) {
- cout << "Yes, sum = " << leftSum << endl;
- }
- else {
- cout << "No, diff = " << abs(leftSum - rightSum) << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement