U E D R , A S I H C RSS

새싹교실/2011/Noname

1.

1회2회3회4회5회6회
OX
OOOOOO
OX
XOOOO

2.


  • : F4(ThreeFs + Future Action Plan) .
    • : ThreeFs, ThreeFs(크), FiveFs(크)

      • Facts, Feelings, Findings, Future Action Plan. , , , , 획.
      • : " 5 .() .() .() .( 획)"

3.1. 1회

3.1.1.

  • Hello World!



3.2. 2회

3.2.1.

  • : .

    • .
  • : scanf함

  • char1 byte(8 bit)-128 +127
    int4 byte(32 bit)-2,147,483,646 +2,147,483,647
    short int2 byte(16 bit)-32,768 +32,767
    long int4 byte(32 bit)-2,147,483,646 +2,147,483,647
    float4 byte(32 bit)10^-37 10^38
    double8 byte(64 bit)10^-307 10^308

3.2.2.

  • . 한 . , . -

3.2.3.

  • .

3.3. 3회

3.3.1.

  • : , , , , , 트,
    • - (+, -, *, /, %)
    • - (=, +=, -=, *=, /=, %=)
    • - (<, >, <==, >==, ==, !=)
    • - (a++, a--, ++a, --a)
    • - (&&, ||)
    • - (&, |, ^, ~, <<, >>)
    • - ( ? 1: )
  • #define함

    • 형 함(){

      }
      int add(int a, int b){
          int add = a + b;
          return add
      }
      

    • #define함
      #define ADD(x,y) (x)+(y)

3.3.2.

  • #define함 . C 한 함 . C . . -
  • ;; . . -

3.4. 4회

3.4.1.

  • (if, switch)
    • if
      • Syntax

if (expression) {  	
 	statement1;
 	statement2;
	:
}
else {
	statement1;
	statement2;
         :
}
  • else if if-else if-else!!
  • Switch
    • Syntax

switch ( expression ){
	case constant-expression :
		statements
	case constant-expression :
		statements
	case constant-expression :
		statements
	..
	default :
		statements
	}

  • switch statement break .

3.4.2.

  • . . . . . ㅎㅎ -

  • If,If-Else,Switch . . 하 . . If Switch . Switch If . -

3.5. 4회

3.5.1.

  • (for, while, do while)
    • for
      • Syntax

for(expr1; expr2; expr3){
	statement1;
	statement2;
	:
}
  • expr1 화. expr2 . expr3 .
  • expr1 ->
expr2 -> statement행 -> expr3 ->
expr2 -> statement행 -> expr3 ->
:
expr2 -> for .
for .

  • While
    • Syntax

while(expression){
	statement1;
	statement2;
	:
}
  • while expression for .
  • expression statement 행한.
  • 해 while .
  • Do-While
    • Syntax

do{
	statement1;
	statement2;

}while(expression);
  • while do_while statement .( .)


3.5.2.

  • . .( ..ㅠ) . ㅎㅎ -

  • . 형태 . 편한 . . .



3.6. 5회

3.6.1.

  • . , .


*
**
***
****
*****
 ****
  ***
   **
    *

3.7. 6회

3.7.1.



    • Factorial 함

#include <stdio.h>

int factorial(int n);

int main()
{
	int a;
	printf(" 팩토 ? ");
	scanf("%d", &a);
	printf("%d",factorial(a));

} 
int factorial(int n){
	if(n==1){
		return 1;
	}else
		return n*factorial(n-1);
}


#include<stdio.h>
int fibo(int x);
int main()
{
	int x;
	printf("  ? ");
	scanf("%d",&x);
	printf("%d",fibo(x));			

return 0;
}

int fibo(int x)
{
	if(x==2)
		return 1;
	else if
		(x==1)
		return 1;
	else
		return fibo(x-1)+fibo(x-2);
}


  • 탑 함

#include<stdio.h>

int hanoi(int n,char,char,char);
int main()
{
    int n;
	printf("하   ?");
    scanf("%d",&n);
    hanoi(n,'a','c','b');
    return 0;
}
int hanoi(int n,char from,char to, char temp)
{
    if(n==1)  {
		printf("%d  %c %c \n",n,from,to);
		return 0;
	}
    hanoi(n-1,from,temp,to);
    printf("%d  %c %c \n",n,from,to);
    hanoi(n-1,temp,to,from);
 }

3.7.2.

  • . . . 하 . -
    • int return하 ? -
    • .. ㅋㅋ -

3.8. 7회

3.8.1.


    • .
    • index .

    • 화 할 호 {} .
    • index .
    • ex) a1 = 10;

3.8.2.

  • ㅠㅠ 포 . -

3.9. 8회

3.9.1.


    • 1 2 .
    • 2 편하 1 .


#include <stdio.h>

int main(){

	int stu[2][3]={{20114231,20116849,20113837},{47,85,76}};
	int i,max=0,h=0;
	for(i=0;i<=2;i++){

		if(stu[1][i]>max){
			max=stu[1][i];
			h=i;
		}
	}
	printf("%d",stu[0][h]);
	return 0;
}

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:42
Processing time 0.0425 sec