На python:
def CountVowel(string):
countVowel = 0;
for i in string:
if i == 'а' or i == 'е' or i == 'ё' or i == 'и' or i == 'о' or i == 'у' or i == 'ы' or i == 'э' or i == 'ю' or i == 'я':
countVowel+=1
return countVowel
lst = ['кошка','кофе','телевизор','автомобиль']
rang = range(len(lst))
for i in rang:
lst[i] = CountVowel(lst[i])
print(lst)
Ответ:
Объяснение:Ответ в прикреплённой фотографии
1)
Var
A,B:integer;
Begin
ReadLn(A,B);
if (A>0)and(B>0) then WriteLn(A*B)
else WriteLn(A*A+B*B);
End.
2)
Const
N=30;
Var
A:array[1..N] of integer;
Begin
For var i:= 1 to N do
Begin
A[i]:=random(100)-50;
Write(A[i]:3,' ');
End;
WriteLn;
For var i:= 1 to N do
Begin
if i mod 2 = 0 then A[i]:=0
else if i mod 5 = 0 then A[i]:=A[i]*2;
Write(A[i]:3,' ');
End;
End.
Program gt;
var a:array[1..100]of integer;
n,i:integer;
begin
read(n);
for i:=1 to n do
read(a[i]);
for i:=1 to n do
if(a[i]<=0)then write(a[i],' ');
for i:=1 to n do
if(a[i]>0)then write(a[i],' ');
end.
На c++
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int k;
cin >> k;
if (k >= 0)
{
k *= k;
cout << k << endl;
}
else
{
cout << k << "<0" << endl;
}
_getch();
return 0;}