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.txttest 고...\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.txttest.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 게 .





















