@BoyStyle
7 / 7 / 0
Регистрация: 24.02.2014
Сообщений: 303
|
19.05.2014, 22:09
[ТС]
|
|
Подправил всё ошибки, но результат остается тем же
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
34
35
36
37
38
39
| #include <iostream>
#include <math.h>
#include <cstdlib>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main()
{
setlocale(LC_ALL, "Russian");
using namespace std;
int k1=0,i,j,s,e,d,k,M[10],m[10],C[10];
s=0;
cout <<"Введите К"<<endl;
cin>>k;
for(i=1;i<=k;i++)
{
cout<<"Введите М["<<i<<"]=";
cin>>M[i];
}
for (i=1;i<=k;i++)
cout<<M[i]<<"\t";
cout<<endl;
int p=0;
for (i=1;i<=k-p;i++)
{
if (M[i]==0)
{ p++;
for(int j=i; j<=k-p; j++)
M[j]=M[j+1];
}
}
cout <<endl;
cout<<"Обработанный массив 2"<<endl;
for (i=1;i<=k-p;i++)
cout<<M[i]<<"\t";
cout<<endl;
cout<<s<<endl;
system ("pause");
} |
|
0
|