Uploaded by Asadbek Xudoyberdiyev

asad (1)

advertisement
Xudoyberdiyev Asadbek
Amaliyot ishi N – 27
Mavzu: STACK,QUEUE,DEQUEUE(STEK,NAVBAT,DEK)
27. N ta elementdan tashkil topgan navbat berilgan. Navbatning o’rtadagi elemntini o’chiring.
#include <iostream>
#include <iostream>
using namespace std;
int main() {
const int N =5;
int array[N];
for (int i = 0; i < N; ++i) {
array[i] = i + 1;
}
if (N > 0) {
int middleIndex = N / 2;
for (int i = middleIndex; i < N - 1; ++i) {
array[i] = array[i + 1];
}
-N;
}
for (int i = 0; i < N; ++i) {
cout << array[i] << " ";
}
return 0;
}
Download