السلام عليكم ورحمه الله ~
ان شاء الله تكونو تمام ؟؟
أرجو المساعده في حل هذا البرنامج يقوم بعمل ادخال مصفوفه ثم نحذف العناصر المتكررة وبعدها يعمل ازاحه للعناصر > وهذا الشي اللي صعب علي > _ <
Write
a
program
that
takes
an
array
of
integers
in
random
order
and
eliminates
all
the
duplicate
integers
in
the
array.
Here
is
an
example.
Suppose
the
array
passed
to
the
function
is
as
shown
below:
Then
the
program
should
alter
the
array
so
that
it
looks
like
this:
Hint:
??
means
garbage
value
18
returns:
0 1 2 3 4 5 6 7 8 9 10
58 | 26 | 91 | 34 | 70 | 34 | 88 | 29 | 41 | 10 | 66
37. Then the function should alter the array so that it looks like this:
0 1 2 3 4 5 6 7 8 9 10
58 | 26 | 91 | 70 | 66 | ?? | ?? | ?? | ?? | ?? | ??
ودآ الكود >بس انا استخدمت اليوز هو اللي يدخل الرقم اللي يبغى يحذفه وهو المفروووض مو كدآ "
#include<conio>
#include<vector>
using namespace std;
int main()
{
int a[10];
int value,found=0,i,j;
for(i=0 ; i<=10 ;i++)
cin>>a;
cout<<"value = ";
cin>>value;
for(i=0;i<=10;i++)
if(a==value)
{
found++;
break;
}
if(!found)
cout<<"not exist"<<endl;
else
{
for(i;i<9;i++)
a=a[i+1];
for(i=0;i<9;i++)
cout<<a<<" ";
cout<<endl;
}
system("pause");
return 0;
}