전체 글 214

c++ 문제 풀이 - 객체의 정렬 2

이번에는 선생님께서 주신 문제를 풀어보고, 복습하는 개념으로 블로그를 작성했습니다. #include#include#include#includeusing namespace std;class Person { public:int height; public:int weight; public:int num;};bool Comp(Person a, Person b) { if (a.height == b.height) return a.weight > b.weight; return a.height > n; vector arr(n); for (int i = 0; i > arr[i].height >> arr[i].weight; arr[i].num = i + 1; } sort(arr.begin(), arr.end(), Co..

백준 c++ 33556 문제 풀이

문제 링크 : https://www.acmicpc.net/problem/33556목차1. 설명 2. 내 코드 3. 문제 풀이 해석 내용 4. 실행 결과 설명백준 브론즈 1 문제 입니다.문제명 : Java String Equals 내 코드#include#include#include#includeusing namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(NULL); std::cout.tie(NULL); string A, B; getline(cin, A); getline(cin, B); if (A == "null") { cout 문제 풀이 해석 내용 문자열 입력 처리string A, B;..

c++ 2025.04.20
728x90