A very nice explanation at

http://www.rawkam.com/?p=345

On Tue, Sep 14, 2010 at 3:16 PM, soundar <soundha...@gmail.com> wrote:

> #include <iostream>
> #include <cstring>
> #include <conio.h>
> using namespace std;
> int main()
> {
>
>    int n,a[30],temp[30],x;
>    cin >> n;
>    memset(temp,0,sizeof(temp));
>    for(int i=0;i<n;i++)
>      cin >> a[i];
>    cin >> x;
>    temp[x-a[0]]=1;
>    for(int i=1;i<n;i++)
>    {
>       if(temp[a[i]]==1)
>          cout << a[i] << x-a[i];
>       else
>       temp[x-a[i]]=1;
>    }
>    getch();
> }
>
>
> correct me if i am wrong.....
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to