用python :输入 20 个整数,统计其中正数、负数和零的个数

    技术2024-10-18  22

    # 输入 20 个整数,统计其中正数、负数和零的个数 num = 1 positive = 0 negative = 0 zero = 0 while num <= 20: a = int(input()) num += 1 if a > 0: positive += 1 elif a < 0: negative += 1 else: zero += 1 print(positive) print(negative) print(zero)
    Processed: 0.009, SQL: 9