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 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

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

Powered by Blogger.