@zss
Модератор
6834 / 6396 / 2136
Регистрация: 18.12.2011
Сообщений: 16,792
|
22.03.2014, 19:31
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| #include<iostream>
#include<conio.h>
using namespace std;
int main()
{
const int n=5;
int A[n],B[n];
for(int i(0);i<n;i++)
{
cin>>A[i];
B[i]=0;
}
cout<<"--------------"<<endl;
k=0;
for(int i=0;i<n;i++)
{
bool nopresent=true;
for(int j=0;j<k;j++)
{
if(A[i]!=B[j])
{
nopresent=false;break;
}
}
if(nopresent)
b[k++]=A[i];
}
cout<<"k= "<<k;
_getch();
return 0;
} |
|
1
|