fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int arr[]={1,-2,1,0,5};
  7. int n=sizeof(arr)/sizeof(arr[0]);
  8. int t=0;
  9. for(int i=0;i<n;i++){
  10. for(int j=i+1;j<n;j++){
  11. if(arr[i]+arr[j]==t){
  12. cout<<true;
  13. return 0;
  14. }
  15. }
  16. }
  17. cout<<false;
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty