回 帖 发 新 帖 刷新版面

主题:十万火急的一题,必看!

[em10][em10][em10][em10][em10][em10][em10][em10][em10][em10][em10][em10]
输入N个数,求大于0的数的个数,小于0的数的个数,等于0的数的个数.
快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快快

回复列表 (共3个回复)

沙发

板凳

这还用做!!!!!!!!!!!!
用个case语句不就行了!!!!!!

3 楼

var j,k,n,l,i:longint;
a:array[1..n] of longint
begin
readln(n);
j:=0;
k:=0;
l:=0;
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
if a[i]>0 then j:=j+1
else
if a[i]=0 then k:=k+1
else
l:=l+1;
writeln('>0',j,'  ','=0',k,'  ','<0',l);
readln;
end.

我来回复

您尚未登录,请登录后再回复。点此登录或注册