728x90
반응형
문제 : https://codeup.kr/problem.php?id=1108
문제 설명
hello를 20번 연속출력한 다음 한 칸을 띄우고(공백 한칸(줄바꿈 아님)) world를 연속 30번 출력하시오.
# include <stdio.h>
int main()
{
int i,j = 0;
for(i = 1; i<=50; i++)
{
if(i <=20)
printf("hello");
if(i >20)
printf("world");
if(i == 20)
printf(" ");
}
return 0;
}
728x90
반응형
최근댓글