c++
c++ 1025 : [기초-입출력] 정수 1개 입력받아 나누어 출력하기
c++ 1025 : [기초-입출력] 정수 1개 입력받아 나누어 출력하기
2020.10.30#define _CRT_SECURE_NO_WARNINGS #include int main() { int a, b, c, d, e; scanf("%1d%1d%1d%1d%1d", &a, &b, &c, &d, &e); printf("[%d]\n", a * 10000); printf("[%d]\n", b * 1000); printf("[%d]\n", c * 100); printf("[%d]\n", d * 10); printf("[%d]\n", e * 1); return 0; }
c++ 1024 : [기초-입출력] 단어 1개 입력받아 나누어 출력하기
c++ 1024 : [기초-입출력] 단어 1개 입력받아 나누어 출력하기
2020.10.30#include #include using namespace std; int main() { string word; cin >> word; for (const auto str : word) cout
c++ 1023 : [기초-입출력] 실수 1개 입력받아 부분별로 출력하기
c++ 1023 : [기초-입출력] 실수 1개 입력받아 부분별로 출력하기
2020.10.30#define _CRT_SECURE_NO_WARNINGS #include int main() { int i, j; scanf("%d.%d", &i, &j); printf("%d\n%d\n", i, j); return 0; } visual studio code 버전 2005 이후로 printf 와 scanf 를 사용하면 에러가 납니다 그걸 방지하기위해 printf_s 와 scanf_s 를 사용할수있지만 에러를 무시하기위해 #define _CRT_SECURE_NO_WARNINGS 를 선언했습니다.
c++ 1022 : [기초-입출력] 문장 1개 입력받아 그대로 출력하기
c++ 1022 : [기초-입출력] 문장 1개 입력받아 그대로 출력하기
2020.10.30#include #include using namespace std; int main() { string str; getline(cin, str); cout
C++ 1021 : [기초-입출력] 단어 1개 입력받아 그대로 출력하기(설명)
C++ 1021 : [기초-입출력] 단어 1개 입력받아 그대로 출력하기(설명)
2020.10.30#include using namespace std; int main() { string str; cin >> str; cout
c++ 익명 객체 (anonymous)
c++ 익명 객체 (anonymous)
2020.10.30#include using namespace std; class A { public: void print() { cout
c++ 문자열에서 특정 문자만 제거하기
c++ 문자열에서 특정 문자만 제거하기
2020.10.30#include #include using namespace std; int main() { string sentence = "i like coding"; sentence.erase(remove(sentence.begin(), sentence.end(), ' '), sentence.end()); cout
c++ 문자열 이동하기(move)
c++ 문자열 이동하기(move)
2020.10.30#include #include #include using namespace std; int main() { string str1 = "i like coding"; string str2 = move(str1); cout
c++ 문자열 일부 지우기(erase)
c++ 문자열 일부 지우기(erase)
2020.10.29#include #include using namespace std; int main() { string sentence = "i hate coding"; sentence.erase(0, 7); cout
c++ static member function (정적 멤버 함수)
c++ static member function (정적 멤버 함수)
2020.10.29#include using namespace std; class Something private: static int s_value; public: static int getValue() { return s_value; } int temp() { return this->s_value; } }; int main() { Something s1; Something s2; cout
c++ 문자열 중간에 삽입하기
c++ 문자열 중간에 삽입하기
2020.10.28#include #include using namespace std; int main() { string sentence = "i coding"; sentence.insert(2, "hate "); cout
c++ 문자열 길이 구하기
c++ 문자열 길이 구하기
2020.10.28#include #include using namespace std; int main() { string fist_name = "ha"; string last_name = "jong yun"; cout