목록전체 글 (351)
printf("ho_tari\n");
-- 1일차 -- 한줄 주석 /* 여러줄 주석 */ /* desc(describe) : 테이블 구조 */ desc emp; desc dept; desc salgrade; -- 1. *을 이용한 테이블 전체 열 출력 select * from emp; -- 2. 테이블 부분 열 출력 select empno, ename from emp; -- 물리적 공간의 특성으로 데이터의 정렬 순서를 보장하지 않는다. select ename, empno from emp; -- 중복데이터 삭제 : DISTINCT SELECT deptno FROM emp; -- 열 중복 제거 (열이 한개인 경우) SELECT DISTINCT deptno FROM emp; -- 열 중복 제거 (열이 여러개인 경우) SELECT job, dept..
#include #include "employee.h" int main() { //Employee e; //Employee e = e1; //e = e1; //Employee employee[5]; Employee *pEmployees[5]; pEmployees[0] = new Employee(1, "hotari", 0); pEmployees[1] = new Employee(2, "c++", pEmployees[0]); pEmployees[2] = new Employee(3, "python", pEmployees[0]); pEmployees[3] = new Employee(4, "matlab", pEmployees[2]); pEmployees[4] = new Employee(5, "arduino", pE..
#include #include "complex.h" #include int main() { Complex c1; Complex c2 = 3.0; // Complex c2(3.0) Complex c3(3.0, 4.0); const Complex c4 = c3; // const Complex c4(c3) c1.real(c3.real()); c1.imag(c3.imag()); c1 = c3; if (c1 == c3) { std::cout
#include #include "rational.h" int main() { Rational r1; // 0 Rational r2(3); // 3/1 Rational r3(3,4); // 3/4 std::cout den * rhs.num; int den1 = this->den * rhs.den; int gcd = GCD(num1,den1); return Rational(num1/gcd,den1/gcd); } Rational Rational::operator-(const Rational &rhs) { int num1 = this->num * rhs.den - this->den * rhs.num; int den1 = this->den * rhs.den; int gcd = GCD(num1,den1); ret..
#include #include "rational.h" int main() { Rational r1(3,4); Rational r2(3); Rational r3; r3 = r1; if (r1 == r3) { std::cout den * rhs.den); result.num = (this->num * rhs.den - rhs.num * this->den)/gcd; result.den = (this->den * rhs.den)/gcd; return result; } Rational Rational::operator*(const Rational &rhs) { Rational result(this->num * rhs.num,this->den * rhs.den); int gcd = GCD(this->num * r..
#include #include "complex.h" int main() { Complex c1(3.0,4.0); // 3.0 + 4.0i Complex c2(3.0); // 3.0 + 0i Complex c3; // 0 + 0i //c3.real(c1.real()); //c3.imag(c1.imag()); c3 = c1; c2 = c1-c3; if (c1 == c3) { std::cout real()-rhs.re, this->imag()-rhs.im); return result; }