Нужно перевести на си
program prog;
uses crt;
const n = 10;
var a: array[1..n] of integer;
i: integer;
count: integer; b
egin clrscr;
randomize;
count := 0;
for i := 1 to n do begin a[i] := random(n) + 1;
write(a[i], );
if ((not odd(i)) and odd(a[i])) then inc(count);
end;
writeln;
writeln(Count: , count);
readkey; end.

#include
#include

main(){
    #define N 10
    int i,count=0;
    int a[N];
    srand(time(0));
    for (i=0; i        a[i]=rand()%(i+1)+1;
        printf("%d ",a[i]);
        if ((i%2==0) && (a[i]%2!=0)) count++;
    }
    printf("nCount=%dn",count);
    system("pause");
}

Оцени ответ
Подпишись на наш канал в телеграм. Там мы даём ещё больше полезной информации для школьников!

Загрузить картинку