목록전체 글 (418)
Creative Code
※main.cpp파일 #include #include "string.h" int main() { String s1; String s2 = "hello, world"; // String s2("hello,world"); //String s2 = 0;// NULL String s3 = s2; // String s3(s2); s1 = s2; String s4 = " IoT"; s1 = s2 + s4; s1 = "hello, "; //String tmp("hello, "); if (s1 == s2) std::cout
#include int main() { int a, b; std::cin >> a >> b; //cin.operator>>(a) std::cout
https://www.acmicpc.net/problem/2981 2981번: 검문 트럭을 타고 이동하던 상근이는 경찰의 검문을 받게 되었다. 경찰은 상근이가 운반하던 화물을 하나하나 모두 확인할 것이기 때문에, 검문하는데 엄청나게 오랜 시간이 걸린다. 상근이는 시간 www.acmicpc.net #include #include #include #include using namespace std; int gcd(int a, int b){ int c; while (b != 0) { c = a % b; a = b; b = c; } return a; } int main() { int N; cin >> N; vectornum; ios_base::sync_with_stdio(false); cin.tie(NULL);..
※main.cpp파일 #include #include "rational.h" int main() { Rational r1(3,5); Rational r2(2,7); std::cout
※main.cpp파일 #include #include "complex.h" #include "string.h" int main() { Complex c1; Complex c2 = 3.0; Complex c3(3.0,4.0); const Complex c4 = c3; // Complex c4(c3) c1.real(c3.real()); c1.imag(c3.imag()); c1 = c3; if (c1 == c3) std::cout