Topic content:
Your program reads a series of positive integer data, input 1 indicates the end of the input, and 1 is not the input data itself. The number of odd and even numbers in the data read by the program output.
Input format:
A series of positive integers in which the range of integers is (0,100000). If input-1 indicates the end of the input.
Output format:
Two integers, the first integer representing the number of odd numbers in the read data, and the second integer representing the number of even numbers in the read data. Two integers are separated by a space.
Input Sample:
9 3 4 2 5 7-1
Sample output:
4 2
time limit: 500ms memory limit: 32000kb
#include <stdio.h>intMain () {intA, Ji =0, OU =0; scanf ("%d", &a); while(A! =-1) {if((a%2) ==1) {Ji++; }Else{ou++; } scanf ("%d",&a);} printf ("%d%d", Ji,ou); return 0;}
Parity number Onge Teacher C Programming Cap 4th Chapter programming problem