|
Stack,queue,dequeue(stek,navbat,dek)
|
tarix | 27.12.2023 | ölçüsü | 4,47 Kb. | | #200198 |
|
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
#include
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;
}
Dostları ilə paylaş: |
|
|