0 дауыс
933 көрілді

n элементтен тұратын a бүтін сандар массивін енгізіп ондағы теріс емес сандарды анықтау қажет болсын!

2 жауап

+5 дауыс
 
Жақсы жауап

#define N50

void main ()

{ int a[N], i , m=0;
for (i=1; i<=N; i++)
 {
  cout<<"a["<<i<<"]=";
  cin>>a[i];
}
for (i=1; i<=N; i++)
if (a[i]>=) 
{
  cout<<a[i]<"  "; m++;
}
cout<<endl << "Massivtegi teris emes alementter sani: " <<m;
 getch();
}
0 дауыс
var n,i,a,c:longint;
begin
read(n);
c:=0;
for i:=1 to n do
begin
   read(a);
    if a>0 then inc(c);
end;
write('In this array we have ',c,' positive numbers.');
end.
...