IF문

 

기본

if(조건)    //조건 : 예)부등식

{

//조건을 만족할 때 수행할 것들

}

else

{

//조건을 만족하지 않는 모든 경우에 수행할 것들

}

 

항상 실행

if(true)    //true대신 1 이상의 정수 가능

{

//수행할 것들

}

 

실행 안함

if(false)    //false대신 0 가능

{

 

}

 

 

SWITCH문

 

기본

switch(변수)

{

case 1 :     //첫 번째 경우

//수행할 것들

break;

case 2 :    //두 번째 경우

//수행할 것들

break;

default :    //첫 번째, 두 번째 모두 아닌 경우

//수행할 것들

}

 

 

WHILE문

 

기본

while(조건)

{

//수행할 것들

}

 

항상 실행

while(true)    //true 대신 1사용 가능

{

//수행할 것들

}

 

우선 do를  한 번 실행한 후 조건에 맞는 경우 do 실행

do

{

//수행할 것들

} while(조건);

 

 

FOR문

 

기본

for(초기 값 ; 조건식 ; 증감식)

{

//수행할 것들

}

 

계속 실행

for(;;)

{

//수행할 것들

}

'Programming > C' 카테고리의 다른 글

C언어 정리(4)  (0) 2015.07.20
C언어 정리(3)  (0) 2015.07.20
C언어 정리(1)  (0) 2015.07.20
Exercise 10-1  (0) 2015.05.07
Exercise 9-3  (0) 2015.05.07

 

 형식 지정자

의미

예 

%d 

정수를 10진수로 출력 

··· -2, -1, 0, 1, 2 ···

 %f

소수점이 있는 실수로 출력

 0.1, 0.05, 3.14

 %c

문자 형태로 출력

 a, C

 %s

문자열 형태로 출력

 sweet, honey

 

 

 

자료형

설명

바이트수 

범위 

정수형

부호있음

short

short형 정수 

2

-32768 ~ 32767

int

정수

4

-2147483648 ~ 2147483647

long

long형 정수

4

-2147483648 ~ 2147483647

부호없음

unsigned short

부호없는 short형 정수

2

0 ~ 65535

unsigned int

부호없는 정수

4

0 ~ 4294967295

unsigned long

부호 없는 long형 정수

4

0 ~ 4294967295 

char

문자 및 정수

1

-128 ~ 127

문자형

부호있음

unsigned char

문자 및 부호없는 정수

1

0 ~ 255

부호없음

float 

단일정밀도 부동소수점

4

1.2E-38 ~ 3.4E28

부동소수점형

double

두배정밀도 부동소수점

8

2.2E-308 ~ 1.8E308

 

 

 

'Programming > C' 카테고리의 다른 글

C언어 정리(3)  (0) 2015.07.20
C언어 정리(2)  (0) 2015.07.20
Exercise 10-1  (0) 2015.05.07
Exercise 9-3  (0) 2015.05.07
Exercise 9-1  (0) 2015.05.07

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>도서 대출 예약</title>
<style>
#a{

 border-radius : 10px;
 width : 500px;
 background: #f8ffe8; /* Old browsers */
 background: linear-gradient(to bottom,  #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%); /* W3C */
 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f8ffe8', endColorstr='#b7df2d',GradientType=0 ); /* IE6-9 */
 
}
 #b{
 border : 3px solid red;
 border-radius : 5px;
 background : pink;
  }
</style>
</head>
<body>
<form>
<fieldset id="a">
 <legend id="b">도서 대출 예약</legend>
 <span>
 <label for="n">성명 : </label>
 <input type="text" id="n" required>
 </span>
 <br>
 
 <label for="n">전화 : </label>
 <input type="text" id="n" placeholder="00*-000-*0000">
 <br>
 
 <label for="n">이메일 : </label>
 <input type="email" id="n" placeholder="***@***.***">
 <br>
 
 <label for="n">도서명 : </label>
 <input type="text" id="n" required>
 <br>
 
 <label for="n">예약 희망일 : </label>
 <input type="date" id="n" required>
 <br>
 
 <label for="n">수령시간 : </label>
 <input type="time" id="n" required>
 <label for="n">에서</label>
 <input type="time" id="n" required>
 
 <label for="n">사이</label>
 <br>
 
 <hr>
 
 <input type="submit" value="예약하기">
</fieldset>

 


</form>

 

 

</body>
</html>

 

<결과>

 

 

'Programming > HTML5' 카테고리의 다른 글

[8장]HTML5 태그(5) - 멀티미디어 태그  (0) 2015.03.20
[7장]HTML5 태그(4) - 멀티미디어 태그  (0) 2015.01.28
[6장]HTML5 태그(3)  (2) 2015.01.27
[5장]File Zilla 사용법  (0) 2015.01.24
[4장]HTML5 태그(2)  (0) 2015.01.24

 

Exercise10-1.txt

 

 

'Programming > C' 카테고리의 다른 글

C언어 정리(2)  (0) 2015.07.20
C언어 정리(1)  (0) 2015.07.20
Exercise 9-3  (0) 2015.05.07
Exercise 9-1  (0) 2015.05.07
난수 10개 정렬  (0) 2015.05.07

 

Exercise9-3.txt

오류나서 다시 해볼께요

'Programming > C' 카테고리의 다른 글

C언어 정리(1)  (0) 2015.07.20
Exercise 10-1  (0) 2015.05.07
Exercise 9-1  (0) 2015.05.07
난수 10개 정렬  (0) 2015.05.07
사다리타기  (0) 2015.05.07

 

Exercise9-1.txt

 

 

'Programming > C' 카테고리의 다른 글

Exercise 10-1  (0) 2015.05.07
Exercise 9-3  (0) 2015.05.07
난수 10개 정렬  (0) 2015.05.07
사다리타기  (0) 2015.05.07
가위바위보  (0) 2015.04.08

 

난수 10개 발생.txt

 

 

'Programming > C' 카테고리의 다른 글

Exercise 9-3  (0) 2015.05.07
Exercise 9-1  (0) 2015.05.07
사다리타기  (0) 2015.05.07
가위바위보  (0) 2015.04.08
블랙잭  (0) 2015.04.08

 

사다리타기.txt

 

 

'Programming > C' 카테고리의 다른 글

Exercise 9-1  (0) 2015.05.07
난수 10개 정렬  (0) 2015.05.07
가위바위보  (0) 2015.04.08
블랙잭  (0) 2015.04.08
유클리드호제법으로 최대공약수 구하기  (0) 2015.04.08

 

가위바위보.txt

 

 

'Programming > C' 카테고리의 다른 글

난수 10개 정렬  (0) 2015.05.07
사다리타기  (0) 2015.05.07
블랙잭  (0) 2015.04.08
유클리드호제법으로 최대공약수 구하기  (0) 2015.04.08
재귀함수로 구구단 짜기  (0) 2015.04.03

 

블랙잭.txt

 

'Programming > C' 카테고리의 다른 글

난수 10개 정렬  (0) 2015.05.07
사다리타기  (0) 2015.05.07
가위바위보  (0) 2015.04.08
유클리드호제법으로 최대공약수 구하기  (0) 2015.04.08
재귀함수로 구구단 짜기  (0) 2015.04.03

+ Recent posts