This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdlib.h> | |
char * input(void) | |
{ | |
register char ch, * string = (char*)calloc(sizeof(char), sizeof(int)); | |
for (register int count = 0; (string[count] = getchar()) != '\n' || (string[count] = 0); string = (char*)realloc(string, sizeof(char)*++count + sizeof(int))); | |
return string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char * strmid(register char * string, register int start, register int len) | |
{ | |
int string_len = strlen(string) > len ? len : strlen(string); | |
register char * str = (char *)calloc(sizeof(char), string_len + sizeof(int)); | |
for (int i = start; i <= string_len; i++) | |
str[i - start] = string[i]; | |
return str; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
정수를 받아들여 오름차순으로 보관하는 클래스 구현 | |
1. pseudo code를 포함한 어떤 언어를 사용하든 상관 없음 | |
2. 정확한 문법은 무시해도 좋고 논리만 알아볼 수 있으면 됨 | |
3. 클래스 이름 : xArray | |
4. 구현해야 할 멤버 함수 | |
bool Seek(int i) : 주어진 인자의 정수가 있는지 확인, 중복 보관 없음 | |
bool Add(int i) : 새로운 정수를 보관, 위의 Seek 함수 이용 | |
bool Del(int i) : 주어진 정수를 제거, 위의 Seek 함수 이용 | |
5. 그 외 필요한 멤버 변수나 함수 등은 제한 없음 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
template<typename type>void print_vector(std::vector<type> vector) | |
{ | |
for_each(vector.begin(), vector.end(), [](type n){static int temp = 0; cout << temp++ << " : " << n << endl; }); | |
} | |
template <typename type> std::vector<type> fibonacci(type n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<vector> | |
#include<stack> | |
#include<algorithm> | |
#include<iostream> | |
#include<functional> | |
using namespace std; | |
template <typename type> void vector_in(vector<type> * vec, int count) | |
{ | |
for (int i = 0; i < count; i++) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<vector> | |
#include<algorithm> | |
#include<string> | |
#include<iostream> | |
using namespace std; | |
#pragma warning (disable : 4996) | |
template <typename type> type _max(type a, type b) | |
{ | |
return a > b ? a : b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<queue> | |
#include<algorithm> | |
using namespace std; | |
typedef struct { | |
int start, end, value; | |
}vertex_value; | |
vertex_value vertex_value_in() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
#include<algorithm> | |
#include<math.h> | |
typedef struct{ | |
int x, y; double tan; int index; | |
}POINT; | |
int main() | |
{ | |
int vertex_max; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <stack> | |
#include <algorithm> | |
typedef struct { | |
int x, y; | |
double tan; | |
int index; | |
}POINT; | |
int main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <math.h> | |
using namespace std; | |
struct Point { | |
double x, y; | |
}; | |
struct d_p { |
OlderNewer