K

@kimjuha19

클래스(숫자 정렬)

C++
9 months ago
#include <iostream> using namespace std; class NumberSet { private: int numbers[5]; public: void inputNumbers() { for (int i = 0; i < 5; i++) {

클래스(학생 성적 관리

C++
9 months ago
#include <iostream> #include <string> using namespace std; class Student { private: string name; int score; public:

클래스(책 도서관)

C++
9 months ago
#include <iostream> #include <string> using namespace std; class Book { public: string title; string author; Book(string t = "", string a = "") {

클래스(버블정렬)

C++
9 months ago
#include <iostream> using namespace std; void bubble_sort(int list[], int n) { int i, j, temp; for(i = n - 1; i > 0; i--) { for(j = 0; j < i; j++) { if(list[j] > list[j + 1]) { temp = list[j];

클래스(문자열 뒤집기)

C++
9 months ago
#include <iostream> #include <string> using namespace std; void re(string& str) { int n = str.length(); for (int i = 0; i < n / 2; i++) { swap(str[i], str[n - i - 1]); } }

클래스(버블 정렬)

C++
9 months ago
#include <iostream> using namespace std; class Sorter { private: int arr[5]; public: Sorter(int a[5]) { for (int i = 0; i < 5; i++) arr[i] = a[i];

클래스(은행 계좌)

C++
9 months ago
#include <iostream> using namespace std; class Account { public: string name; int balance = 0; void deposit(int m) { balance += m;

클래스(학생 평균 점수)

C++
9 months ago
#include <iostream> using namespace std; class Student { public: int A; int B; int C; void gasan() {

c++(은행 계좌)

C++
9 months ago
#include <iostream> using namespace std; class Account { public: string name; int balance = 0; void deposit(int m) { balance += m;

c++(자동차 주행 거리)

C++
9 months ago
#include <iostream> using namespace std; class car{ public : string name; int distance; void move(int km){ distance += km; } }

c++(자동차 주행 거리)

C++
9 months ago
#include <iostream> using namespace std; class Car { public: string name; int distance = 0; void move(int km) { distance += km;

클래스(자동차)

C++
9 months ago
#include <iostream> using namespace std; class Car { private: string brand; int speed; public: Car(string b, int s) {

클래스(책)

C++
9 months ago
#include <iostream> using namespace std; class Book { public: string title; int price; Book(string t,int p){

클래스(학생 정보)

C++
9 months ago
#include <iostream> using namespace std; class Student { public: string name; int age; void printlnfo() { cout << "name: " << name << ", age: " << age << endl;

10(주전)

C++
10 months ago
#include <iostream> using namespace std; int& minRef(int &a,int &b){ return (a < b) ? a : b; } int main() { int a = 12,b = 8; cout << minRef(a,b) <<endl;

9(참조)

C++
10 months ago
#include <iostream> using namespace std; int& maxElement(int arr[], int size){ int maxEle = 0; for (int i = 0; i < size;i++) { if (arr[i] > arr[maxEle]) { maxEle = i; } }

8(참조)

C++
10 months ago
#include <iostream> using namespace std; void add(int &x,int &y,int &sum){ sum = x + y; } int main() { int x = 3, y = 7,sum; add(x,y,sum);

7(참조)

C++
10 months ago
#include <iostream> using namespace std; void changString(string &s){ s = "C++ 참조"; } int main() { string str = "Hello!";

6(참조)

C++
10 months ago
#include <iostream> using namespace std; void square(int &n){ n = n * n; } int main() { int a = 4;

5(참조)

C++
10 months ago
#include <iostream> using namespace std; int main() { int arr[3] = {1,2,3}; int &a = arr[1]; a = 999; for (int i = 0; i < 3; i++) { cout << arr[i] <<endl;