Codeforces 519B. A and B and Compilation Errors Solution

 Solution in C++:

///**********ALLAH IS ALMIGHTY************///

///AH Tonmoy

///Department of CSE,23rd batch

///Islamic University,Bangladesh 

  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,s1=0,s2=0,s3=0,i;
  6. cin>>n;
  7. int a[n+1];
  8. for(i=0; i<n; i++)
  9. {
  10. cin>>a[i];
  11. s1=s1+a[i];
  12. }
  13. for(i=0; i<n-1; i++)
  14. {
  15. cin>>a[i];
  16. s2=s2+a[i];
  17. }
  18. for(i=0; i<n-2; i++)
  19. {
  20. cin>>a[i];
  21. s3=s3+a[i];
  22. }
  23. cout<<s1-s2<<endl;
  24. cout<<s2-s3<<endl;
  25. }

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.