BAJARDI:FARMONOB BEHZOD;
TEKSHIRDI:DJANGAZOVA QUMRINISO;
.U(K) massivining musbat, toq indeksli elementlarining yig‘indisini toping.
YECHILISHI;
#include
#include
using namespace std;
int main(){
int u[5]={1,3,-4,5,4},s=0;
for(int i=0;i<5;i++){
cout<<"u["< }
for(int i=0;i<5;i++) {
if(u[i+1]%2==1) {
cout<<"u["< s=s+u[i+1];
}
}
cout<<"s="< return 0;
}
Do'stlaringiz bilan baham: |