السابق التالي
0 / 21
الوحدة النمطية DEMO-32-109DEMO-C-32

Count Positive

DEMO-C-32 • Programming in C

Browser-only practice

بيان المشكلة

Write a program to count how many positive numbers exist in an N x M matrix.

قيود

1 <= N, M <= 10. Integers within standard range.

تنسيق الإدخال

Input: Dimensions N M followed by the matrix elements.

تنسيق الإخراج

Output: The formatted result as specified.

حالات اختبار نموذجية

Submit runs every public testcase in this browser. Results and code never leave this device.

العينة رقم 1
عينة ظاهرة
2 2
30 41
-2 39
3
Found 3 positive numbers in 2x2 matrix.
العينة رقم 2
عينة ظاهرة
4 5
-9 31 22 22 44
27 28 -2 7 16
18 28 -8 8 27
14 -6 19 0 22
15
Found 15 positive numbers in 4x5 matrix.
العينة رقم 3
عينة ظاهرة
4 5
0 -7 10 15 43
18 20 37 5 -1
24 35 33 48 28
37 23 8 -8 -7
15
Found 15 positive numbers in 4x5 matrix.
العينة رقم 4
عينة ظاهرة
5 5
39 6 16 45 48
37 49 14 36 27
15 -8 -9 47 31
39 40 37 17 -3
3 -7 14 40 17
21
Found 21 positive numbers in 5x5 matrix.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
إعدادات المحرر