#include <stdio.h> int y() { int a; scanf("%d",&a); int i; if(a%2==0){ for(i=1; a>=i; i++){ if(i%2==0) printf("%d ",i); } } else for(i=1; a>=i; i++){ if(i%2==1) printf("%d ",i); } } int main(void) { y(); return 0; }
2016.08.20 11:31
홀수면 n수까지 홀수 출력 짝수면 n수까지 짝수 출력(승민)
조회 수 465 추천 수 0 댓글 0