: 폰트의 색상 값을 적용할 때 사용
h1 { color: 색상 값; }
body { color:black }; /* By color names */
body { color:#000000 }; /* Hexademical colors */
body { color:#000 }; /* Hexademical -> 두 자리씩 같으면 축약 가능 */
body { color:rgb(0, 0, 0) }; /* As RGB values(R,G,B / 0~255) */
body { color:rgba(0, 0, 0, 1) }; /* (alpha / 0~1, 투명도) */
/* 이외에도 HSL values, HWB values 등 다양한 방식으로 선언 가능 */
: 요소의 배경을 컬러나 이미지로 적용할 때 사용
background-color
- 기본값: transparent
- background의 색상을 지정
background-image
- 기본값: none
- 배경으로 사용할 이미지의 경로를 지정
- 절대 경로와 상대 경로 모두 사용 가능
background-repeat
- 기본값: repeat
- 이미지의 반복 여부와 방향을 지정
- 속성값
background-position
- 기본값: 0% 0%, left top 값이 기준
- 요소에서 배경 이미지의 위치를 지정
- 속성값
background-attachment
- 기본값: scroll
- 화면 스크롤에 따른 배경 이미지의 움직임 여부를 지정
- 브라우저 성능에 영향을 미치므로 자주 사용되지는 않음
- 속성값
background 축약형
background: color image repeat attachment position;

: 요소의 실제 내용을 포함하는 영역, 크기는 내용의 너비 밑 높이
: content 영역을 감싸는 테두리 선
: 속성과 속성값에 대하여 정의하지 않으면 모두 기본값이 적용된다.
	border-width: 6px 6px 3px 3px; /* top right bottom left */
    	border-width: 6px 3px; /* top&bottom right&left */
        border-width: thin;
	border-style: none solid double dotted; /* top right bottom left */
    	border-style: solid none; /* top&bottom right&left */
        border-style: dotted;
	border-color: red green yellow pink; /* top right bottom left */
    	border-color: blue black; /* top&bottom right&left */
        border-color: orange;
border: width style color;
: content 영역과 테두리 사이의 여백, content 영역에 배경, 색 또는 이미지가 있을 때 이 영역까지 영향을 미치므로 content의 연장으로 볼 수도 있음
: 정의하지 않은 속성과 속성값의 경우에 바로 기본값이 적용되지 않고, 상하 좌우의 값이 같을 경우 합쳐서 적용할 수 있다.
+) CSS에서는 0 값에 대해 따로 단위를 적지 않는다!
padding: [-top] [-right] [-bottom] [-left];
           0      10px     20px      30px   /* 상, 우, 하, 좌 다름 */
           0      10px     20px             /* 좌, 우 같음 */
           0      10px                      /* 상, 하 같음 & 좌, 우 같음 */
           0                                /* 상, 우, 하, 좌 모두 같음 */
           /* 시계 방향 순서대로 적용한다고 생각하기! */
: border 바깥쪽 영역, 주변 요소와의 여백을 지정할 수 있음
margin-left: auto; margin-right:auto;margin: [-top] [-right] [-bottom] [-left];
           0      10px     20px      30px   /* 상, 우, 하, 좌 다름 */
           0      10px     20px             /* 좌, 우 같음 */
           0      10px                      /* 상, 하 같음 & 좌, 우 같음 */
           0                                /* 상, 우, 하, 좌 모두 같음 */
           /* 시계 방향 순서대로 적용한다고 생각하기! */
: 인접한 두 개 이상의 수직 방향 박스의 마진이 하나로 합쳐지는 것
| + | - | auto | 단위 | |
|---|---|---|---|---|
| margin | O | O | O | px, %, ... | 
| padding | O | X | X | px, %, ... | 
#include <stdio.h>
#include <stdlib.h>
int main(void) {
	printf("난수의 범위: 0부터 %d까지\n", RAND_MAX);
	for (int i = 0; i < 5; i++)
		printf("난수 출력: %d\n", rand() % ((99 - 0) + 1) + 0);
		// rand() % ((원하는 최댓값 - 원하는 최솟값) + 1) + 원하는 최솟값
	return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void) {
	srand((int)time(NULL));
	printf("주사위 1의 결과 %d\n", rand() % ((6 - 1) + 1) + 1);
	printf("주사위 2의 결과 %d\n", rand() % ((6 - 1) + 1) + 1);
	return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void) {
	int inputnum, comnum = 0;
	int win = 0; int draw = 0;
	while (1) {
		printf("바위는 1, 가위는 2, 보는 3: ");
		scanf("%d", &inputnum);
       		srand((int)time(NULL));
		comnum = rand() % ((3 - 1) + 1) + 1;
        
		printf("당신은 %d 선택, 컴퓨터는 %d 선택, ", inputnum, comnum);
		if (comnum - inputnum == -1 || comnum - inputnum == 2)
		{
			printf("당신이 졌습니다!\n");
			break;
		}
		else if (comnum - inputnum == 1 || comnum - inputnum == -2) {
			printf("이겼습니다!\n");
			win++;
		}
		else {
			printf("비겼습니다!\n");
			draw++;
		}
	}
	printf("게임의 결과: %d승 %d무\n", win, draw);
	return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void) {
	srand((int)time(NULL));
	int temp;
	int com[3];
	int user[3];
	int strike = 0, ball = 0;
	int game = 0;
	srand((int)time(NULL));
	for (int i = 0; i < 3; i++) {
		temp = (rand() % 9) + 1;
		com[i] = temp;
		for (int j = 0; j < i; j++) {
			if (temp == com[j] && i != j)
				i--;
		}
	}
	while (1) {
		while (1) {
			strike = 0; ball = 0;
			printf("3개의 숫자 선택: ");
			scanf("%d %d %d", &user[0], &user[1], &user[2]);
			
			if (user[0] == user[1] || user[1] == user[2] || user[2] == user[0]) {
				printf("중복되는 숫자를 입력하셨습니다. 다시 입력해주세요.\n");
			}
			else if ((user[0] < 0) || (user[0] > 9) || (user[1] < 0) || (user[1] > 9) || (user[2] < 0) || (user[2] > 9)) {
				printf("범위 외의 숫자를 입력하셨습니다. 0~9 사이의 숫자를 입력해주세요.\n");
			}
			else
				break;
		}
		for (int i = 0; i < 3; i++) {
			if (com[i] == user[i])
				strike++;
		}
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++) {
				if (i != j) {
					if (com[i] == user[j])
						ball++;
				}
			}
		}
		game++;
		printf("%d번째 도전 결과: %d strike, %d ball!\n", game, strike, ball);
		if (strike == 3)
			break;
	}
	printf("\nGame Over!\n");
	return 0;
}