Skip to content

Instantly share code, notes, and snippets.

View fpdjsns's full-sized avatar
😄
인생의 풍류를 즐기는 중

withham fpdjsns

😄
인생의 풍류를 즐기는 중
View GitHub Profile
@fpdjsns
fpdjsns / Quick_Sort(Recursive).cc
Last active October 13, 2016 07:19
학생 정보(학번, 이름, 성적)을 입력받아 성적 순 학번 순으로 퀵정렬
#include<stdio.h>
#include<string.h>
#pragma warning(disable:4996)
#define MAX 100
typedef struct student
{
int hakbun; //학번
char name[40]; //이름
#include<stdio.h>
#define MAX 100
typedef struct{
int left; //하한
int right; //상한
}element; //스택 구조체
element stack[MAX];
int top = -1; //스택 top=-1
@fpdjsns
fpdjsns / Sum_in_a_row.cc
Created October 27, 2016 05:24
연속합 구하기
#include<iostream>
using namespace std;
int main()
{
int N;//정수 갯수
int arr;
int now_sum, max_sum;
int max_num;//입력 받은 수 중 최대 수
@fpdjsns
fpdjsns / Pair_descending_order.cc
Last active October 28, 2016 13:42
pair descending order using sort function.
#include<iostream>
#include<algorithm>
using namespace std;
bool compare(const pair<int, int>& a, const pair<int, int>& b)
{
//If the first number is same
if (a.first == b.first)
return a.second > b.second; //The second number in Descending order
@fpdjsns
fpdjsns / 실수 출력.cc
Last active April 18, 2020 09:44
실수 출력(정수 부분, 반올림, 올림, 내림)
#include<iostream>
using namespace std;
int main()
{
float ans, temp;
ans = 4.7777;
temp = ans;
#include<iostream>
using namespace std;
int gcd(int a, int b)
{
if (b == 0) return a;
else
return gcd(b, a%b);
}
@fpdjsns
fpdjsns / 유리수의 사칙연산(Rational number Four fundamental rules of arithmetics).cc
Last active February 7, 2017 05:34
유리수의 사칙연산(Rational number Four fundamental rules of arithmetics)(add, subtraction, multiplication, division
#include<iostream>
using namespace std;
typedef struct _Rational {
int bunZa, bunMo;
} Rational;
//Greatest common divisior(최대공약수)
int GCD(int a, int b)
#include<iostream>
#include<string.h>
#include<stack>
using namespace std;
int main()
{
stack<char> s1; //커서 앞
stack<char> s2; //커서 뒤
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#pragma warning(disable:4996)
#define MAX 100
//트리 노드
typedef struct node
{
char alphabet; //알파벳
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#pragma warning(disable:4996)
#define MAX 100
#define alph_num 26
//트리 노드
typedef struct node
{