본문 바로가기

개발자 모드/C언어

C언어 초를 받아서 시분초로 표시

728x90
#include <stdio.h>

int main (void)
{
	
	int second = 0;

	printf("초를 입력하시오\n");

	scanf_s("%d", &second);

	printf("%d시 %d분 %d초",second/3600, (second%3600)/60, (second % 3600)%60);

	return 0;
}

 

 

728x90

'개발자 모드 > C언어' 카테고리의 다른 글

C언어 자판기 소스코드  (0) 2021.03.08
C언어 기초 극장 예매 시스템  (0) 2021.03.08
C언어 기초 야구 게임  (0) 2021.03.08
C언어 카드 뒤집기 게임  (0) 2021.03.08
C언어 로또 번호 생성 프로그램  (0) 2021.03.07