ComputerScience(15)
-
[BJ15973] 두 박스 .
https://www.acmicpc.net/problem/15973 15973번: 두 박스 표준 입력으로 두 박스의 정보가 한 줄에 하나씩 주어진다. 각 박스의 정보는 왼쪽 아래 꼭짓점 좌표 (x1, y1)과 오른쪽 위 꼭짓점 좌표 (x2, y2)로 구성되는데 이들 좌푯값 x1, y1, x2, y2 (x1 < x2, y1 < y2)가 공백을 사이에 두고 주어진다. www.acmicpc.net 맞긴맞았으나 내 풀이가 너무길고 맘에 안든다 숏코딩한사람들의 10배정도 되는거같은데 이렇게 안풀기를 다짐하면서 코드를 박제함 #include #include #include #include using namespace std; #define pii pair int main() { int box1[2][2]; int ..
2019.07.24 -
문자열(string)으로 입력받기, 문자열 쪼개기::string stream
sstream = string + stream ios,iostream의 함수들을 상속받아 사용가능 (>>, > s; cout k) { cout n) { cout
2019.07.09 -
클래스 템플릿// 멤버함수의 외부 선언
클래스 템플릿(Class template)의 멤버 함수를 외부에 선언할 때 다음과 같이 작성한다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 //classA.h header file template class A { . . . void function(T data){ . . } . . }; //클래스 내부 선언 ---------------------------------------------------------- template class A { . . . void function(T); . . }; template void A::function(T data){ . . }//외부선언 Colored by Color..
2019.05.12