Пользователь Windows
SPecialiST RePack
2-labaratoriya ishi
Dasturlash II fanidan
Guruh: 715-20
Bajardi: Bozorova Durdona
Variant 11
1. Barcha ro‘yxat elementlarini ekranga chop etuvchi funksiyani yozing (c++ da ishlandi)
#include
#include
using namespace std;
int main(){
list mylist {1,2,3,4,5};
for(auto it=mylist.begin(); it!=mylist(); ++it)
cout<<' '<<*it;
return 0;
}
2. Dekning har 2 ta elementidan keyin ularning yig‘indisini joylang. (Pyhtonda ishlandi)
my_list=[]
for i in range(10):
my_list.append(eval(input(f"enter {i+1}-element: ")))
for i in range(0,10,2):
print(f"{my_list[i]}+{my_list[i+1]}",my_list[i]+my_list[i+1],end="\t",sep="=")
2-misolni Javascript ishlangan varianti.
let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
let s = 0;
let array = [];
for (let i = 0; i
s = arr[i] + arr[i + 1];
console.log(s);
array[i] = s;
}
console.log(array);
Do'stlaringiz bilan baham: |