random int, double, char, string => byte
This file contains hidden or 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
// https://rextester.com/KAY13591 | |
// import modules | |
#include <iostream> | |
// define Character class | |
class Character { | |
private: | |
// declare fields | |
int x; |
This file contains hidden or 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
// cs-assignment 2-2 "Byte Manipulation - Byte Level Operation" | |
// @author shj | |
// import modules | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define STR_SIZE 10 // string size | |
#define TESTING_TIMES 30 // for unit-testing |
This file contains hidden or 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
// cs-assignment 2-4 "Byte Manipulation - Integer Addition" | |
// @author shj | |
// import modules | |
#include <stdio.h> | |
#include <limits.h> // for get limits the values of various variable types | |
/** | |
* integer addition with unsigned short int type | |
* @param a first operand |
This file contains hidden or 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
/** | |
* tcp socket programming (client-side) | |
* @author shj | |
*/ | |
// import module | |
const net = require('net'); | |
// create TCP socket | |
const client = new net.Socket(); |
This file contains hidden or 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
/** | |
* compute RTT values | |
* (DevRTT, EstimatedRTT, TimeoutInterval) | |
* @author shj <https://github.com/Gumball12> | |
* */ | |
// import module | |
#include <stdio.h> | |
#include <stdlib.h> // for absolute value function 'abs' |
This file contains hidden or 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 <stdio.h> | |
/** | |
* swap function | |
* @param xp pointer x | |
* @param yp pointer y | |
* */ | |
void swap(long *xp, long *yp) { | |
// define temporary values | |
long temp0 = *xp; |
This file contains hidden or 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
λλ¬Όμ(X) :- | |
μ²μΆ(X). | |
ν¬μ λ₯(X) :- | |
μ²μΆ(X), | |
not(μκΉ(X)). | |
μ‘°λ₯(X) :- | |
μ²μΆ(X), | |
μκΉ(X), |
-
νμ
- μνκ³΅κ° λ΄μμ
- μμμνμμ λͺ©νμνκΉμ§μ κ²½λ‘λ₯Ό μ°Ύλ κ²
- κ° μνλ₯Ό μμ±νλ κ²μ μ°μ°μ λΌκ³ ν¨
-
μν, μ°μ°μ, κ·Έλ¦¬κ³ μν νΈλ¦¬λ₯Ό μ΄μ©ν΄ λ΅μ μ°Ύμλκ°λ κ²
- λ¬Όλ‘ μ΄λ₯Ό μ§μ νλ‘κ·Έλλ° νμ§λ μμΌλ©°, DFS/BFS λ₯Ό μ¬μ©ν΄ νμ΄λκ°
-
μκ³ λ¦¬μ¦
-
Shape
ν΄λμ€- μμμ μν ν΄λμ€
private
μ κ·Όμλ₯Ό κ°λname
νλκ° μ‘΄μ¬Shape
ν΄λμ€λ₯Ό μμλ°λ ν΄λμ€λgetArea
λ©μλλ₯Ό λ°λμ ꡬνν΄μΌλ§ ν¨getArea
λ©μλλ λνμ λμ΄λ₯Ό λ°ν
-
Rect
ν΄λμ€