Advertisement
elephantsarecool

el3

Jan 23rd, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int a[1000];
  6.     int m,n;
  7.     cin>>n;
  8.     for(int i=0;i<n;++i)
  9.         cin>>a[i];
  10.     cin>>m;
  11.     for(int i=0;i<n;++i)
  12.         for(int j=i;j<n;++j)
  13.             if(a[i]+a[j]==m)cout<<i+1<<' '<<j+1<<endl;;
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement