c/기초

정올 134 : 반복제어문2-형성평가5

phantom0219 2019. 1. 11. 14:26



My Solution


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<stdio.h>
int main(void){
    int i=0,num=0,even=0,odd=0;
    for(i=1;i<=10;i++){
        scanf("%d",&num);
        if(num%2==0){
            even++;
        }
        else{
            odd++;
        }
    }
    printf("\neven : %d",even);
    printf("\nodd : %d",odd);
    return 0;
}
cs


반응형