이진수 중, 0
으로 시작하는 수는 양수, 1
로 시작하는 수는 음수이다. 이러한 방식을 2의 보수 표현법(two's complement)이라 부른다.
이진수의 연산에서, 작은 수에서 큰 수를 빼면, 0
으로 시작하는 수에서 빌림을 수행하여, 1
로 시작하는 수가 된다.
0011 1000 - 0100 0111 = 1111 0001
11 11
#include <stdio.h> | |
#include <string.h> | |
#define MAX 10000 | |
#define BUFFER_SIZE 100 | |
char *words[MAX]; | |
int n = 0; | |
void bubblesort(); |
Jun 28 06:50:48 mx sshd[14680]: Failed password for invalid user ubnt from 218.3.60.58 port 60026 ssh2 | |
Jun 28 06:50:49 mx sshd[14682]: Failed password for invalid user admin from 218.3.60.58 port 60069 ssh2 | |
Jun 28 06:50:51 mx sshd[14684]: Failed password for invalid user support from 218.3.60.58 port 60115 ssh2 | |
Jun 28 06:50:52 mx sshd[14686]: Failed password for root from 218.3.60.58 port 60297 ssh2 | |
Jun 28 06:50:58 mx sshd[14688]: Failed password for invalid user user from 218.3.60.58 port 60340 ssh2 | |
Jun 28 06:50:59 mx sshd[14690]: Failed password for root from 218.3.60.58 port 60695 ssh2 | |
Jun 28 06:50:59 mx sshd[14692]: Failed password for root from 218.3.60.58 port 60751 ssh2 | |
Jun 28 06:51:01 mx sshd[14694]: Failed password for invalid user guest from 218.3.60.58 port 60795 ssh2 | |
Jun 28 06:51:02 mx sshd[14696]: Failed password for invalid user pi from 218.3.60.58 port 60921 ssh2 | |
Jun 28 06:51:03 mx sshd[14698]: Failed password for invalid user ftpuser from 218.3.60.58 port 60982 ssh2 |
int is_leap_year(int year) | |
{ | |
if(year % 400 == 0 || year % 4 == 0 && year % 100 != 0) return 1; | |
return 0; | |
} |
#include <iostream> | |
class parent | |
{ | |
protected: | |
int a; | |
public: | |
parent(const int a) : a(a) {} | |
bool is_equal(parent &p) { return p.a == a; } /* Can access protected (even private) member data in same class (p.a) */ |
{ | |
"collegeTextbook": | |
{ | |
"list": | |
[ | |
{ | |
"title": "2015년 1학기", | |
"desc": "2015년 1학기 교재 구입 목록", | |
"course": | |
[ |
{"exp_step":[29,79,149,239,349,479,629,799,989,1199,1429,1679,1949,2239,2549,2879,3229,3599,3989,4399,4829,5279,5749,6239,6749,7279,7829,8399,8989,9599,10229,10879,11549,12239,12949,13679,14429,15199,15989,16799,17629,18479,19349,20239,21149,22079,23029,23999,24989,26489,28009,29549,31109,32689,34289,35909,37549,39209,40889,42589,44309,46049,47809,49589,51389,53209,55049,56909,58789,60689,62609,64549,66509,68489,70489,72509,74549,76609,78689,80789,82909,85049,87209,89389,91589,93809,96049,98309,100589,102889,105209,107549,109909,112289,114689,117109,119549,122009,124489,127489,130509,133549,136609,139689,142789,145909,149049,152209,155389,158589,161809,165049,168309,171589,174889,178209,181549,184909,188289,191689,195109,198549,202009,205489,208989,212509,216049,219609,223189,226789,230409,234049,237709,241389,245089,248809,252549,256309,260089,263889,267709,271549,275409,279289,283189,287109,291049,295009,298989,999999],"stamina":[40,41,41,42,42,43,43,44,44,45,45,46,46,47,47,48,48,49,49,50,50,50,51,51,51,52, |
:: Copyright (C) 2014 Jongmin Kim / kdzlvaids@gmail.com | |
:: This program is free software: you can redistribute it and/or modify | |
:: t under the terms of the GNU General Public License as published by | |
:: the Free Software Foundation, either version 3 of the License, or | |
:: (at your option) any later version. | |
:: This program is distributed in the hope that it will be useful, | |
:: but WITHOUT ANY WARRANTY; without even the implied warranty of | |
:: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
#ifndef ALGORITHM_ADT_STACK_H_ | |
#define ALGORITHM_ADT_STACK_H_ 1 | |
namespace algorithm | |
{ | |
namespace adt | |
{ | |
template<class Element> | |
class Stack |
/* https://dl.dropboxusercontent.com/u/16142350/ProbSolving2016/chap03/practice01.pdf */ | |
#include <stdio.h> | |
#define O_SIZE_MAX 100 | |
#define O_PNONE 0 | |
#define O_PBLACK 1 | |
#define O_PWHITE 2 | |
int bsize; | |
int bgame[O_SIZE_MAX][O_SIZE_MAX]; |