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.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.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.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.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.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.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.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.6.2.1.

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

1.6.2.2.

  • '->' !

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

1.6.2.3. 곽길

1.6.2.4.

  • ,

    . 근

1.7. 6(6/13)

1.7.1.

  • ...--;

1.7.2.

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.14.3.


1.15. 2-7(10/17)

1.15.1.

  • 1~7
  • ( 기, Airline Ticketing)
  • 23 , 30

1.15.2.

  • 기, Airline Ticketing 1

1.15.3.

1.16. 2-8(10/31)

1.16.1.


  • virtual, , 객

1.16.2.

  • 7

1.16.3.

1.17. 2-9(11/7)

1.17.2.


1.17.3.


1.18. 2-10(11/14)

1.18.2.


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