Contents
1. ¶
| 학 | |
| 06 | |
| 12 | 한표 |
| 12 | 훈 |
| 12 |
4.2.1. 회 ¶
- 한표 : . , 훈 하 해 . 하 , 행 해 . wiwki 해 , 편할 . Virtual Box . Hello World 환 한편 환 한 . 플 . 해하 하 .
- 훈 : 험했 " " 하 . 할 . 퓨 3 wiki 한해 . 한 하. 환 . . 한 학 하. 했.. 화호 . 한 하.
- : 톤(208-216) , 한표, 훈 3 21 PM6 gcc, Linux, android example, wiki . 해 트 할 .
- :훈, 한표, 행해. 크 . . , 학 . 팍팍 . 2 해 하 해 큰 .
4.3.2. ¶
- : 6 PC 6 해
/2012//2
/2011//4
- 2
- Linux gedit 해 .
- 하 . ? 통해 표, 훈 . 하 호 .
- -> C 템 해 합. 함 .
- printf(), scanf() ?
- int, char, float, long, double 표 해 . , , . ?
- #define 해 . #define 크 해 편하 ? 해 회 .
- 헤 파 한 . math.h 학 함. time.h 함 했 .srand(time(NULL)) .
- if, switch()case: default:}, for, while 해 . 흐 편하 할 . switch case break

- ACM
4.3.3. ¶
- 한표 - 하
#include<stdio.h>
int main() {
int a,b,c,d;
scanf("%d %d %d",&a,&b,&c);
if(a>b) {
d=b;
b=a;
a=d;
}
if(b>c) {
d=c;
c=b;
b=d;
}
if(a>b) {
d=b;
b=a;
a=d;
}
printf("%d %d %d",a,b,c);
return 0;
}
- - 하
#include <stdio.h>
int main(void)
{
int num;
printf("Input integer.");
scanf("%d", &num);
if(num % 400 == 0)
printf("Leap");
else if((num % 4 == 0) || (num & 100 != 0))
printf("Leap");
else
printf("Normal");
return 0;
}
- 훈 - 하
#include<stdio.h>
int main()
{
int a,b,c;
int d;
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
d=b;
b=a;
a=d;
}
if(b>c)
{ d=c;
c=b;
b=d;
}
if(a>b)
{
d=b;
b=a;
a=d;
}
if(a==b || a==c || b==c )
{
printf("Impossible");
}
else printf("%d %d %d",a,b,c);
return 0;
}
4.3.4. 2 ¶
- 한표 - 판하
#include<stdio.h>
int main(void)
{
unsigned int y;
scanf("%u",&y);
if(y%400==0) {
printf("Leap\n");
return 0;
}
if(y%100==0) {
printf("Normal\n");
return 0;
}
if(y%4==0){
printf("Leap\n");
}
printf("Normal\n");
return 0;
}
- 훈 - 판하
#include<stdio.h>
int main()
{
long long n;
bool t = 0;
scanf("%lld",&n);
if(n%4==0)
{
t = 1;
if(n%100 == 0)
{
t = 0;
if(n%400 == 0)
{
t = 1;
}
}
}
if(t)
{
printf("Leap");
}
else
{
printf("Normal");
}
return 0;
}
4.4.1. ICE breaking ¶
- - 했. 트 했. 1 . 했. map editor 히 . . 학 . C 할해. 훅훅 . . 학 . .
- 훈 - . 학 . 학 . MT 할 . 했. 했. 했. 해 . 했. . . 트 하 . 해 *^^*
- - 패 하 . . 톤 트 . 포 하 . 활 하 . 한 한 했. 휴학 학 24 학 10 힘. ~ 하 4 =ㅂ= !!!! 표 4 . 함. 해!
4.4.3.1. 한표 (2012/4/3, 4/4) ¶
- - C . . . 편하 하 . int , char , float . 편하 ? 해 . 0 1 화할텐?
- if
int a = 5;
if(a >3){
printf("a 3 큽.\n");
}
else printf(" .\n");
- for
for(1,2,4){
3;
}
for(i = 0;i<5;i++){
}
- while
a = 5;
while(a>3){
a--;
}
printf("%d",a);
-
+-*/% ||&& != == <= >= ~^&| ++i i++
+-*/%
|| && : || 한 &&
!= == <= >= :
~^&| 트 : char 1byte -> 8bit ~ 0 1 ^ & 1 1 | 한 1 1 함.
- 호 ()
- ++i i++ i = i +1; 행 .
- 함 : 행 화해 .
- : int 4byte (address) .
- 포 : 포 32bit 파 4byte 64bit 파 8byte 크 . (void *), (int *), (float *) . int *a 4byte 할 a (address) . 포 (*) 해 키 . int형 4byte ?
- 함 C Call-by-value 합. 항 통해 하.
- Call-by-value, Call-by-reference
#include<stdio.h>
void swap(int a, int b){
int temp;
temp = a;
a = b;
b = temp;
}
void swap2(int *a, int *b){
int temp;
temp = *a;
*a = *b;
*b = *temp;
}
int main(){
int i=3,j=5;
swap(i,j);
printf("%d %d\n",i,j);
swap2(&i,&j);
printf("%d %d\n",i,j);
return 0;
}
- 함 화 형 Call-by-reference 한 . !
- 함 화 한 함 (naming). 함 파할 !
- (array) 한 하 해
int a[10];하 a int형 10 0~9 (index) .
- a .
scanf("%d",a);a[0]키 .
-
a[2]*(a+2)
- a .
- typedef
- 해 !
- typedef
typedef 할 ;형 하 하 .
- 해 !
///typedef
typedef struct _CALORIE{
char name[40];
float value;
}CALORIE;
CALORIE myfood;
형 CALORIE
- 함 - Call-by-value Call-by-reference .
valuefunc(myfood); referencefunc(&myfood);
- 포 함
- 형 .
- 형 .
CALORIE a;
CALORIE *b = &a;
scanf("%s, %f",a.name,&(a.value)); //a.name a.value ! 했.
printf("%s %.2f\n",a.name,a.value); //
printf("%s %.2f\n",b->name,b->value); //->형
///pcal 40 합.
///num 합.
float calcalc(CALORIE *pcal, int num){
char name[40];
float gram = 0;
float totalcal = 0.0;
int i;
printf("-- 품 -------------\n");
for(i = 0; i<num;i++) // 합
printf("%s\t", (pcal+i)->name); //. 합
printf("\n----------------------------------------\n");
while(1){
printf("품(end 하 합.) : ");
scanf("%s", name);
if(strcmp(name, "end") == 0)
break;
printf(" : ");
scanf("%f", & gram);
for(i=0;i<num;i++){
if(strcmp(name, (pcal+i)->name) == 0){
totalcal += (pcal+i)->value * gram /100.0;
break;
}
}
}
return totalcal;
}
4.4.3.2. 훈 (2012/4/8) ¶
- 한표
- 하
- 함형 포 - 함 포 할 .
- 함 행 ?
#include<stdio.h>
int func(){
return 0;
}
int main(){
printf("%d\n",func(1,2,3,4));
return 0;
}
- 훈 하
4.5.1. 한표 ¶
- 파 한 함
- (파 포함)
- 파 템 합. 해 *(포:Pointer)해 FILE 통해 하 . 파(File) 하 C 하 통해 파 하 FILE . * 통해 FILE . Good Good!
- 파 . 파 , , 크, . 한 항 http://winapi.co.kr/clec/cpp2/17-2-1.htm .
- . ' ' 해 해.
C:\\Desktop\test.txt폴 . ? 하C:\\Desktop\\test.txttxt파 행 ? ? 폴 . 해할? ..\test.txt폴 test파 ...\test.txt폴 . 폴 하?.\\test.txt하. 해 행파 파 하.
- 통해 파 트 표해.
- stdin, stout. 표 해 트. fprintf print .
- 파 템 합. 해 *(포:Pointer)해 FILE 통해 하 . 파(File) 하 C 하 통해 파 하 FILE . * 통해 FILE . Good Good!
#include <stdio.h>
int main(){
int a;
fprintf(stdout,"%d",5);
printf("%d",5);
fscanf(stdin,"%d",&a);
scanf("%d",&a);
return 0;
}
- > 표 했. test.exe파 행키 5 한 합
CMD 파 통해 test.txt
test.exe > test.txt하 test.txt 5 .
- 한표
Git 해 Repository Readme파 .
4.6.1. , 훈 ¶
- : 훈 -> 해 . .
- : 험해 . 해 . 효 해 했. 한 僞! 하 (僞) 히 (惡) 해 . 해 행하 (惡) () 하 . 히 하 . ( ). 하 . 해 한. 하 Just do it! 하 항 . 택 . 형 . 한 . Whatever! 힘 하 한. 항 한.
- : 험해 . 해 . 효 해 했. 한 僞! 하 (僞) 히 (惡) 해 . 해 행하 (惡) () 하 . 히 하 . ( ). 하 . 해 한. 하 Just do it! 하 항 . 택 . 형 . 한 . Whatever! 힘 하 한. 항 한.
- : -> OOP ?
- : 향 (Object Oriented Programming). . 했 . 하 API 행해 해 . 히 Class . 향 C++ Java Class Class 향 . ... . 향 . C Class 했 . 함 포 . 형.
- : 향 (Object Oriented Programming). . 했 . 하 API 행해 해 . 히 Class . 향 C++ Java Class Class 향 . ... . 향 . C Class 했 . 함 포 . 형.
- : , 훈 -> 한?
- : 플 1 하 한 해. 1 하 퓨 할 ? 해 하? . C 편 크트 해 한 플 해 하. 효 화 해 하 하 할 .
- : 플 1 하 한 해. 1 하 퓨 할 ? 해 하? . C 편 크트 해 한 플 해 하. 효 화 해 하 하 할 .
- : , 훈 -> 플 ?
- : Windows API 해하 30 하? 한 . javascript alert(5)? ? ~~ ?
- : Windows API 해하 30 하? 한 . javascript alert(5)? ? ~~ ?
- SVN 킴
- SVN 하 http://nforge.zeropage.org/svn/coordinateedit . . . !!! .
- SVN 하 http://nforge.zeropage.org/svn/coordinateedit . . . !!! .
-
- for 하 for for 탈하 . .
- if 하 0 0 화 키 . !
- for 하 for for 탈하 . .
4.7.1. ¶
<html>
<head>
<script language = "javascript">
left = 10;
function key(){
var image=document.getElementById("demo");
image.style.position="absolute";
alert(left);
left += 1;
image.style.left = left; // left . left .
//image.style.left=(left+1)+'px';
//var l=document.getElementById("demo").style.left += 1;
}
</script>
</head>
<body onKeyDown='key();'>
<img src = "1.jpg" id="demo" top = 10 left = 10>
</body>
</html>
4.8.1. ¶
<-> Objective - C?
크트 ->
- .
- Web View 합.
C 하.
-> Opensource 트
-> . .
한
Sort .
- Bubble Sort
- Quick Sort .
-> .
#include<algorithm.h>
quicksort( );
- Javascript 행해
- Html파 ->
- Html파 ->
- Javascript 학 http://www.w3schools.com/js/default.asp 해.
<html>
<body>
<script type="text/javascript">
document.write("<p>My first paragraph</p>");
</script>
</body>
</html>
- 픈
- GitHub : https://github.com
- Google Code : http://code.google.com/intl/ko-KR/
- GitHub : https://github.com
- SVN 툴 Tortoise : http://tortoisesvn.net/
- 포 : http://sourceforge.net/
4.8.2. ¶
- Quick Sort
- APM
- JavaScript 해
4.9. 5 31 ¶
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void main() {
int i,j,Input;
int temp;
int count = 0;
int a[10] = {0,};
srand(time(NULL));
printf(" \n");
/*
for(i=0;i<10;i++) { // 10
a[i] = rand()%10+1;
printf("%3d", a[i]);
}
*/
do{
temp = rand()%10+1;
for(i = 0;i<10;i++){
if(a[i] == temp){
temp = rand()%10+1;
i = -1;
}
}
a[count++] = temp;
}while(count != 10);
for(i = 0;i<10;i++)
printf("%d ",a[i]);
puts("\n---------------------------------");
/*
for(i=0;i<10;i++)
{
for(j=0;j<9;j++)
{
if(a[j]>a[j+1])
{
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
}
}
}트
*/
/*
for(i=0;i<10;i++)
{
for(j=i+1;j<10;j++)
{
if(a[i]>a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}택 트
*/
for(i=0;i<10;i++) { //
printf("%3d", a[i]);
}
puts("");
}
- : APM , 트(, 택) 5 해.
#include<stdio.h>
int factorial(int n){
if(n == 1) return 1;
return n * factorial(n-1);
}
int summary(int n){
if(n == 1) return 1;
return n + summary(n-1);
}
int main(){
int i,j,sum = 0, fact =1;
int input = 5;
for(i = 1; i <= input;i++){
sum += i;
fact *= i;
}
printf("sum : %d, fact : %d\n",sum,fact);
sum = 0 ; fact =1;
fact = factorial(input);
sum = summary(input);
printf("sum : %d, fact : %d\n",sum,fact);
return 0;
}
- : .
4.10. 6 1 ¶
- Part
<html>
<head>
<script language = "javascript">
left = 10;
imagename = 1;
function key(){
var image=document.getElementById("demo");
image.style.position="absolute";
if(imagename == 4){
imagename = 1;
}
alert(left);
left += 1;
image.src = imagename + '.jpg';
imagename = imagename + 1;
image.style.left = left;
//image.style.left=(left+1)+'px';
//var l=document.getElementById("demo").style.left += 1;
}
</script>
</head>
<body onKeyDown='key();'>
<img src = "1.jpg" id="demo" top = 10 left = 10>
</body>
</html>
- .
- Javascript Tiny Farm? 해.
- -> . ??? . 키?? 힘. 패
-> 함. - -> . ??? . 키?? 힘. 패
-> keyword : javascript image resize crop
-> http://charism.tistory.com/44
-> : http://www.jsmadeeasy.com/javascripts/Images/img_layer/img_layer.htm
-> 합.
-> 키 5 by 5 표
-> .
-> , , 화
-> . => Timer .
-> 표 클하. jAVASCRIPT 해.
-> 투 : http://findfun.tistory.com/348
-> 투 : http://jpjmjh.blogspot.kr/2010/02/ie6-png-투-하.html
4.11.2. ¶
- prime 하.
// public class MyTest { /** * @param args */ public static void main(String[] args) { ///prime 1 하 . int count = 0; boolean flag = false; for(int i = 2; i< 1000; i++){ flag = true; for(int j = 2; j<i; j++){ if( (i % j) == 0) flag = false; } if(flag == true){ System.out.println(i + "is prime Number!"); count++; } } System.out.println("Count : " + count); } }
4.11.3. ¶
- APM_SETUP폴 htdocs폴 index.html 하. http://www.w3schools.com/js/default.asp javascript index.html 하 확.
5.1. 훈 ¶
- 함포 : int *compare(int a, int b), function call 한 stack(FILO : first in last out) 화. int형 포 int형 환해?
- Class
- 험 : http://cau.ac.kr/~bongbong/c12/ final exam 해
- 크트 c asam
- http://www.ted.com/talks/view/lang/ko//id/799 해하.





















