1. def remove(list1, pos): newlist = []
Download 12.82 Kb.
|
Ma\'lumotlar tuzilmasi
1. def remove(list1, pos): newlist = [] for x in range(len(list1)): if x != pos: newlist.append(list1[x]) print(*newlist) list1 = [10, 20, 30, 40, 50] pos = 2 remove(list1, pos); 2. using namespace std; vector { vector for (int i = 0; i < N; i++) if (i <= L || i >= R) B.push_back(A[i]); return B; } // main Driver int main() { int A[] = { 3, 5, 3, 4, 9, 3, 1, 6, 3, 11, 12, 3 }; int L = 2, R = 7; int n = sizeof(A) / sizeof(A[0]); vector for (auto x : res) cout << x << " "; return 0; } 3.int main() { deque mydeque.clear(); // Deque becomes empty // Printing the deque for (auto it = mydeque.begin(); it != mydeque.end(); ++it) cout << ' ' << *it; return 0; } 4. int main() { deque mydeque.push_front(1); // deque becomes 1 if (mydeque.empty()) { cout << "True"; } else { cout << "False"; } return 0; } Download 12.82 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling