U E D R , A S I H C RSS

새싹교실/2012/AClass

1. AClass

1.1.

1.2. 1회(5/9)

1.2.1.

  • 트, if , for

1.2.2.

  • ( ), (1~3) .^^
  • , .c파 .
  • . .( )
    • 한 () ~
  • C ~



    1. (Compile), (Build), 크(Linking) .
    2. 형, , 2 .
    3. char형 . ASCII 통해 .
    4. #include, , include .
    5. #define , 한 '한' .
    6. ++, --, &&, ||, +,-, !=, ==, = .
    7. if, else, else if . else else if 3 .
    8. switch-case .(eg. Grade A,B,C)
      • 90 A, 80 B . 100 10 switch .
    9. while . C .
    10. do-while '' .
    11. for .
    12. 2 for .

1.
*****
 ****
  ***
   **
    *
2.
*
**
***
****
*****
  1. , : .
    • n 화하 .

1.
*******
 *****
  ***
   *
2.
   *
  ***
 *****
*******
 *****
  ***
   *



    1. , for 3, 4 .(hint 2*n-1)

    1. , .
    2. return .
    3. , void return하 .
    4. .
    5. , ( ) .
    6. .

    1. .(eg.1~n 합, n!)
    2. , (Search) .

1.2.3.1. 황혜

  • 1.?
    --> 환하
    2.#include?
    -->
    3.return 0?
    -->
    4. 10 , 10
    -->

#include <stdio.h>
        int main(){
            int a;
            scanf("%d",&a);

            if(a>10)
               printf("%d",a*a);
            else if(a<10)
               printf("%d",2*a);

            return 0;
        }


     #include <stdio.h>

       int main(void)
      {
	int i;
	int j;
	int n;
	int k;

	scanf("%d",&n);


	for(i=n;i>=1;i--)
	{
		for(j=1;j<n+1-i;j++)
		{
				printf(" ");
		}
		for(j=1;j<=2*i-1;j++)
		{
			printf("*");
		}
		printf("\n");
	  }
	  return 0;
      }
         

1.2.3.2.

- for .
- : :*)

1.2.3.3.

  • . ....-L-
    히 하. ..ㅋㅋㅋ ~
    히 해 .. ..ㅋㅋㅋ

1.2.3.4.

  • 히 해
    히 해 !

1.3. 2회(5/16)

1.3.1.

  • . .
    • .


  • 1.0 1000 .
    • /10, %10 .
    2. .
    3. .
    • 2 .
    • if(10>x) printf(" ");.

 1
 2  3
 4  5  6
 7  8  9 10
11 12 13 14 15
16 17 18 19 20 21
4. .

                1
             2  3
          4  5  6
       7  8  9 10
   11 12 13 14 15
16 17 18 19 20 21
5. .( 21 )
6. 형태 .
7. 형태 .
8. 60 F, 61~70 D, 71~80 C, 81~90 B, 90~ A .

#include <stdio.h>
int main(){
	int num;

	printf("  : ");
	scanf("%d", &num);

	switch(num/10){
		case 10 :
		case 9 :
			printf("A\n");
			break;
		case 8 :
			printf("B\n");
			break;		
		default :
			printf("???\n");
			break;
	}
			
}
9.101200 환하 '함' .(main sum=Sum(); printf("%d",sum); )
10. 해 n! .
11.n! for .
12. 해 110 .
13. {7,4,2,9,3,1,2} . 3 .
14. {7,4,2,9,3,1,2} . 1 . (, 7 )
15. {7,4,2,9,3,1,2} . 2 , .
16. {7,4,2,9,3,1,2} . ()하, .

    1. 2 , , .
    2. srand()함 , time() .
    3. , 포 .
    4. , .

1.3.2.1.

* , 함 . , 트 해. .

1.3.2.2.

  • , , .
  • , 히! :-)

1.3.2.3. 황혜

  • :

#include <stdio.h>

int fact(int n)
{
	int sum;

	if(n==1)
		return 1;
	else
		sum=fact(n-1)*n;

	return sum;


}

int main()
{
	int n;

	scanf("%d",&n);

	printf("%d\n",fact(n));

	return 0;
}

swap :
:

: 해하 . :-@
  • .. 80% ! -

1.3.2.4.

  • ,
    편했. 히 해.
    • . 화하 .. -

1.4. 3회(5/23)

1.4.1.1.

1~5.www.koistudy.net 100~104 Accept( 한테 )
6.포 해 함 swap ( . 해해 )
7.2 (4x4) .
8. 형태 .

1  2  3  4  5
10 9  8  7  6
11 12 13 14 15
20 19 18 17 16
21 22 23 24 25
9.포 .
10.LinearSearch . 1000 , random함 해 1 1000 , 777 . ?
(rand()%1000 1 1000 .)
11.Sort . 11 , , .
12. , int* a; int b; &a,a,*a,&b,b , 해할 .( 트해 .)

1.4.1.2.

1. , .
2. , .
3. , 해 2 형태 .
4.택, 큐 , .

1.4.2.1.

  • , 2
  • www.koistudy.net
  • 히! 히! :D

1.4.2.2. 황혜

* 포 .
확하 .

1.4.2.3.

  • , 2 , 포 .
    ㅜㅜ
    !!

1.4.2.4.

.
.

1.5. 4회(5/31)

1.5.1.1.

1~6.Koistudy.net 106~111
7.Koistudy.net 125, 152() 3n+1
  • accept :) accept 패하 ^^
8. 형태 .
  • 8 패하 . :)

1  
3  2  
4  5  6
10 9  8  7
11 12 13 14 15
21 20 19 18 17 16
9.2 3x3행 , .
  • hint) Dp = (int**)malloc(sizeof(int*));
10.3회 10 . . ,
11. , int* a; int b; int **c; &c,c,*c,&a,a , 해할 .
12. 행하, .

int* a;
int b=5;
int** c;
 c=&a;
 a=&b;
 **c=9;
 printf("%d %d",*c,**c);

1.5.1.2.

  1. LinkedList node , 형태 해한 .
  2. Circular Queue .
  3. typedef , .
  4. student , student 0~3 AClass , .
    • char , 학 int형 .
    • , .

1.5.2.1.

  • , ,
    .

1.5.2.2.

  • 100% .
    .

1.5.2.3.

  • ,
  • ! :) .
  • 히 ;^)

1.5.2.4. 황혜


  • 해해 .
    .sizeof 할 크 malloc .
    int* p;
       p = (int *)malloc(SIZEOF(int)*n);

1.6. 5회(6/6)

1.6.1.1.

1.KoiStudy 112~113,115~122 - .
2.Swap함
3.3,4,6,7,9,3,2 2,3,9,7,6,4,3 .(택)
4.BinarySearch , .(!)
  1. . :)

1  2  3  4  5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9
6.LinkedList , 해 linkedlist하 .
7. 해 list . list->next->next = ;
8.LinkedList , 트 data 4,5,3,7,12,24,2,9 .

1.6.1.2.

1.Koistudy163
2.163 , .
3. Palindrome, Not Palindrome .
  • level, racecar, deed palindrome, sadfds not Palindrome

1.6.2.1. 황혜

  • swap함 .
  • .
  • .
  • swap함 &a &b a b .!

1.6.2.2.

  • '->' !

  • '->' '' :-S
  • .

1.6.2.4.

  • ,

    해해.

1.7. 6회(6/13)

1.7.1.

  • ...--;

1.7.2.1.

#include <stdio.h>
#include <stdlib.h>
typedef struct node node;
struct node{
	int data;
	struct node* next;
};

int main(){
	int i;
	node* head=(node*)malloc(sizeof(node));
	node* tmp = NULL;

	tmp=head;

	for(i=0 ; i<10 ; i++){

		tmp->data=i+1;
		tmp->next = (node*)malloc(sizeof(node));
		//printf("%d\n",tmp->data);
		tmp=tmp->next;
	}

	tmp=head;
	for(i=0 ; i<10; i++){
		printf("%d\n",tmp->data);
		tmp=tmp->next;
	}


	return 0;
}

.....

1.7.2.2. 황혜

  • .
  • 해했


#include <stdio.h>

struct node{
	int data;
	struct node *next;
};


int main()
{

	struct node *head=(struct node*)malloc(sizeof(struct node));
	struct node *tmp = NULL;
	int i;
	int n;

	tmp=head;

	for(i=0;i<10;i++)
	{
		tmp->next=(struct node*)malloc(sizeof(struct node));
		tmp->data=i+1;
		
		tmp=tmp->next;

		
		tmp->next=NULL;
	}
	scanf("%d",&n);

	for(tmp=head;tmp->next!=NULL;tmp=tmp->next)
	{
		if(tmp->next->data==n)
			tmp->next=tmp->next->next;
		printf("%d ",tmp->data);	
	}

	
	return 0;

}

1.7.2.3.

  • 트ㅎㅎㅎㅎㅎㅎ
    #include<stdio.h>
    #include<stdlib.h>
    typedef struct node node;
    
    struct node{
    	int data;
    	struct  node *next;
    	};
    int main(void){
    	int i;
    
    	node *head = (node *)malloc(sizeof(node));
    	node *tmp = NULL;
    	
    	tmp = head;
    
    	for(i=0;i<10;i++){
    
    		tmp->data = i;
    		tmp->next = (node *)malloc(sizeof(node));
    
    		tmp = tmp->next;
    		
    	
    	}
    	tmp = head;
    	for(i=0;i<10;i++){
    			printf("%d\n",tmp->data);
    			tmp = tmp->next;
    	}
    	
    
    	return 0;
    }
    
       

1.7.2.4.

~

~~
~

1.8. 2-1회(8/30)

1.8.1.

1.8.2.

  • Overview, 포

1.8.3.

*
c . 포 .
*
. 히 해. :-)
*
! C .

1.9. 2-2회(9/6)

1.9.1.

  • : /2012/AClass/2-2회
  • . .
    1.
    2.Swap
    3.call by value, call by reference , 확히 , .
    4.Linked List , 탐 , 함화해.
    5.Struct?
    6.Object Oriented Programming .
    7. , .
    8.Class?()
    9.Overloading?
    10.public private .
    11.Koistudy 126~130, 146, 148, 149
    • C++ .(cin cout)
    • .

1.9.2.

  • , Swap, OOP, Class, Struct, call by value/reference

1.9.3.


  • pointer, swap, malloc, struct c++ . iostream헤
    using namespace std . using namespace std cin, cout 'std::' .
    c '\n' c++ endl .

  • -#include <iostream> using namespace std;

#include <iostream>
using namespace std;

int main(){
	int a;
	cin>>a;
	cout<<a<<endl;
}

  • swap

#include <stdio.h>
#include <iostream>
int swap(int*, int*);
int main(){
	int a,b;
	a=10;
	b=20;

	swap(&a,&b);
	printf("%d %d\n",a,b);

	return 0;
}
int swap(int *a, int *b)
{
	int temp;
	temp=*a;
	*a=*b;
	*b=temp;

	return 0;
}
-


    • c c++ cin,cout class,std using namespace std

1.10. 2-3회(9/12)

1.10.1.

  • cmd, main parameter, static, const

1.10.2.

1.Koistudy 126~130, 146, 148, 149 -

1.10.3.


  • class .
    private public .
    private .
    public .

  • swap, malloc test
    private public
    private


  • ,public private

1.11. 2-4회(9/19)

1.11.2.

  • static, const ??

1.11.3.




  • LargeInt ! , overflow

    !


  • private, public .
    9 1 .
    .

1.12. 2-5회(9/26)

1.12.1.

  • , , 화, default , this, overloading .
  • struct vs class

1.12.2.

  • Person클 Bird 클 .
    • (0m) , .
    • .(distance)
    • Bird . ( 해) .
    • A,B , A , B .

1.12.3.

  • - , 클 . .... . ,,ㅂ . - 클 .
  • - / private public . + bigInt n.
  • - . this . ......... 폴트 ...

1.13. 2-6회(10/10)

1.13.1.

  • , static, , protected, return형태

1.13.2.

1.13.3.

  • - . protected , . static const .
  • -
  • - , 폴트 , , static

1.14. 2-7회(10/17)

1.14.1.

  • 1~7회
  • ( , Airline Ticketing)

1.14.2.

  • , Airline Ticketing 택 1

1.15. 2-7회(10/17)

1.15.1.

  • 1~7회
  • ( , Airline Ticketing)
  • 23 험, 30

1.15.2.

  • , Airline Ticketing 택 1

1.16. 2-8회(10/31)

1.16.1.


  • virtual, ,

1.17. 2-9회(11/7)

1.18. 2-10회(11/14)

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