[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기Chris Ohk
기존에 작성해 놓은 C++ 코드에 모던 C++를 적용하기는 쉽지 않습니다. 막상 개선하려고 마음먹었다고 해도, 어디서부터 바꿔야 할 지 막막하기만 합니다. 이 세션에서는 기존 C++ 코드에서 모던 C++를 적용해 프로그램의 구조와 성능을 개선하는 방법에 대해서 설명합니다. 그리고 기존 C++ 코드에 모던 C++를 적용할 때 주의해야 될 점에 대해서도 살펴봅니다.
Este documento presenta un análisis de tres radios: Radio Satelital de Loja 100.9, Radio Caribe FM 95.3 y Radio Huancavilca. Resume la programación, objetivos y contenido informativo de cada radio. Radio Satelital de Loja y Radio Caribe FM ofrecen noticieros, entrevistas y programas de entretenimiento. Radio Huancavilca se enfoca principalmente en noticias con varios noticieros diarios y análisis político y económico.
[TechDays Korea 2015] 녹슨 C++ 코드에 모던 C++로 기름칠하기Chris Ohk
기존에 작성해 놓은 C++ 코드에 모던 C++를 적용하기는 쉽지 않습니다. 막상 개선하려고 마음먹었다고 해도, 어디서부터 바꿔야 할 지 막막하기만 합니다. 이 세션에서는 기존 C++ 코드에서 모던 C++를 적용해 프로그램의 구조와 성능을 개선하는 방법에 대해서 설명합니다. 그리고 기존 C++ 코드에 모던 C++를 적용할 때 주의해야 될 점에 대해서도 살펴봅니다.
Este documento presenta un análisis de tres radios: Radio Satelital de Loja 100.9, Radio Caribe FM 95.3 y Radio Huancavilca. Resume la programación, objetivos y contenido informativo de cada radio. Radio Satelital de Loja y Radio Caribe FM ofrecen noticieros, entrevistas y programas de entretenimiento. Radio Huancavilca se enfoca principalmente en noticias con varios noticieros diarios y análisis político y económico.
The document discusses different types of wood, their characteristics, uses, and processing. It defines the differences between wood and timber, and describes softwood and hardwood. It then covers the internal section of wood including the pith, heartwood, sapwood, and growth layers. The rest of the document summarizes different wood-based boards like plywood, blockboard, and MDF. It also discusses veneers, types of veneers, and laminates used in woodwork.
Este documento presenta un análisis de tres radios: Radio Satelital de Loja 100.9 FM, Radio Caribe FM 95.3, y Radio Huancavilca. Resume los objetivos, programación y contenido de cada radio. Radio Satelital de Loja se enfoca en noticias locales, nacionales e internacionales. Radio Caribe transmite principalmente ritmos tropicales y latinos, e incluye un programa de opinión de 18 a 19 horas. Radio Huancavilca ofrece noticieros las 24 horas con análisis de noticias nacionales e internacionales.
Heart disease is a serious condition that mainly affects older people. It occurs when the heart and blood vessels are not working properly. There are many types of heart disease including conditions that affect the heart muscle, blood vessels, heart valves, or cause inflammation of the heart. The main causes of heart disease are smoking, an unhealthy diet lacking in fruits and vegetables, and being overweight. Preventing heart disease involves eating nutritious foods, maintaining a healthy weight, avoiding stress, and not smoking. While heart disease can sometimes be cured through oxygen therapy and medication, prevention is always better.
The document summarizes a story called "The Flowering Tree". It describes a group with 5 members and provides background on the story's author. The story is about two sisters - the younger sister can transform into a flowering tree. Both sisters make garlands from the flowers to sell. The jealous wife of a prince discovers the secret and disables the transforming sister. The couple eventually finds each other with the help of the prince's eldest sister and uses the transformation ritual to heal the injured sister.
2. 1. 조원별 업무 분담
박구남 최종 보고서 작성 및 프로젝트 총괄
정준용 알고리즘에 대한 소스 구현 및 코딩 작업
최고봉 알고리즘에 대한 소스 구현 및 코딩 작업
민영지 K-Combination에 대한 자료조사 및 다른 K-sample등 자료조사
2. 일정
4/9 각 조원들 역할분담 및 자료조사
4/16 초안 검토 및 K-Combination에 관하여 토의
4/18 최종안 확인 및 보고서 작성
3. 3. 자료 조사
원소의 순서
순서 유관 순서 무관
원소의 반복
k-permutation k-combination
비 반복 추출
(k-순열) (k-조합)
반복 추출 k-sample k-selection
중복 원소 추출 pattern partition
k - sample
집합 S로부터 k개를 선택하는 작업 중 하나.
반복을 허락하지만, 다른 순서의 독같은 원소는 목록에서 구별된다.
k - selection
집합 S로부터 k개를 선택 할 경우 반복은 허락하지만, 순서에 상관 없이 같은 원소는 동일
하게 취급하는데, 이 경우의 목록을 집합 S로부터의 k - selection라고 한다.
k - permutations
집합 S로부터 k개를 선택하는데 반복은 허락하지 않는다. 하지만 선택된 원소들의 순서는
목록에서 구별한다.
n개의 원소를 가진 집합으로부터 k-순열의 수는 P(n,k)혹은 nPk라는 기호를 사용한다.
k - combinations
4. 집합 S로부터 k개를 선택하는데 반복을 허락하지 않고 순서에 상관없이 구성.
이 같은 원소는 똑같이 취급하는 경우의 목록을 k-조합(K-Combination)라고 한다.
집합 S의 k-조합은 S의 부분 집합과 정확히 일치한다.
k-조합의 수는 C(n,k)혹은 nCk라는 기호를 사용한다.
초안
#include <stdio.h>
void main(){
char input[43];
char *element;
int *a, *b;
int n,r;
int i,j;
scanf("%s %d",input,&r);
n = (strlen(input)-1)/2;
element = (char *)malloc(n*sizeof(char));
for (i=0,j=0; i<strlen(input);i++){
if(input[i] != ',' && input[i] != '{' && input[i] !='}'){
element[j]=input[i];
j++;
}
}
a = (int *)malloc(r*sizeof(int));
b = (int *)malloc(r*sizeof(int));
for(i=0;i<r;i++){
a[i] = 1;
if(i==0)
a[i] = 0;
}
while(a[0] !=n-r){
b[0] = a[0];
for(i=1;i<r;i++)
b[i]=b[i-1]+a[i];
for(i=0;i<r;i++)
printf("%c",element[b[i]]);
break;
}
a[r-1]++;
for(i=j-1;r-i<r;i--)
a[r-i]=1;
5. printf(",");
}
b[0] = a[0];
for(i=1;i<r;i++)
b[i]=b[i-1]+a[i];
for(i=0;i<r;i++)
printf("%c",element[b[i]]);
free(element);
free(a);
free(b);
getch();
}
초안 구현 및 문제점
b에 의해 결정되어 출력되는 원소가 해당 위치에서 출력 할 수 있는 가장 상위의 원소일때,
이과정을 최상위부터 내려오며 비교를 하는 문장을 넣지못하여 원하는 결과 값이 출력되지
않았습니다.
6. 최종안
#include <stdio.h>
void main(){
char input[43];
char *element;
int *a, *b;
int n,r;
int i,j;
scanf("%s %d",input,&r);
n = (strlen(input)-1)/2;
element = (char *)malloc(n*sizeof(char));
for (i=0,j=0; i<strlen(input);i++){
if(input[i] != ',' && input[i] != '{' && input[i] !='}'){
element[j]=input[i];
j++;
}
}
a = (int *)malloc(r*sizeof(int));
b = (int *)malloc(r*sizeof(int));
for(i=0;i<r;i++){
a[i] = 1;
if(i==0)
a[i] = 0;
}
while(a[0] !=n-r){
b[0] = a[0];
for(i=1;i<r;i++)
b[i]=b[i-1]+a[i];
for(i=0;i<r;i++)
printf("%c",element[b[i]]);
for(j=1; ; j++){
if(b[r-j] == n-j){
a[r-j-1]++;
7. continue;
}
break;
}
a[r-1]++;
for(i=j-1;r-i<r;i--)
a[r-i]=1;
printf(",");
}
b[0] = a[0];
for(i=1;i<r;i++)
b[i]=b[i-1]+a[i];
for(i=0;i<r;i++)
printf("%c",element[b[i]]);
free(element);
free(a);
free(b);
getch();
}
최종안 코딩을 하면서
배열에서 크기를 43으로지정(최대 20개의원소,괄호 2개, 콤마(,)19개)하여 선언하였으며, 입
력받은 문자열에서 원소를 뽑아 동적할당 된 배열에 집어넣었습니다.
프로젝트를 진행하면서..
포인터와 배열에 관해 더 자세하게 알수 있었으며, 조원들끼리 서로 합심하여 모두 적극적
으로 참여 한 결과 프로젝트가 성공적으로 완성되었습니다.
조원들의 적극적인 참여가 일의 능률향상에 도움이 된다는것을 새삼 느꼈으며 조별활동의
장점을 새로 느낄 수 있었습니다.