top of page

소스 코드 제출

공개·회원 52명

2025-08-07

/*

#include <stdio.h>

int main()

{

int h,m,t,a,b;

scanf("%d %d",&h,&m);

scanf("%d",&t);

if(m+t >= 60)

{

a = (m+t)/60;

b = (m+t)%60;

printf("%d %d",(h+a)%24,b);

}

else

{

printf("%d %d",h,m+t);

}

return 0;

}

*/

/**

반복문

1. for

2. while ( if의 반복문버전)


while(조건식)

{

명령;

}


//무한반복

while(1)

{


}


// 1. 1 ~ 5 출력

#include <stdio.h>

int main()

{

int a = 1; // a는 1부터 시작


while(1)

{

printf("%d ",a);

if(a == 5) // a가 5일때 멈추기

{

break;

}

a = a + 1; // a에 1더하기

}


return 0;

}


// 2. 1 ~ 10 출력

#include <stdio.h>

int main()

{

int a = 1; // a는 1부터 시작


while(a<=10) // a가 10이하 라면

{

printf("%d ",a);

a = a + 1; // a에 1더하기

}


return 0;

}


// 3. 1 ~ n 출력

#include <stdio.h>

int main()

{

int a = 1; // a는 1부터 시작


int n;

scanf("%d",&n);


while(a<=n) // a가 n이하 라면

{

printf("%d ",a);

a = a + 1; // a에 1더하기

}


return 0;

}

*/

/*

#include <stdio.h>

int main()

{

int a = 1;


while(1)

{

printf("%d ",a);

if(a == 100)

{

break;

}

a = a + 1;

}

return 0;

}

*/

10회 조회
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546 ,     031) 215 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호
bottom of page