보호되어 있는 글입니다.
# Oval.h #ifndef Oval_H #define Oval_H class Oval { private: int width, height; public: Oval(); Oval(int w, int h); ~Oval(); int getWidth(); int getHeight(); void set(int w, int h); void show(); }; #endif #pragma once # Oval.cpp #include using namespace std; #include "Oval.h" Oval::Oval() :width(1), height(1) {} Oval::Oval(int w, int h) : width(w), height(h) {} Oval::~Oval() { cout
# Adder.h #ifndef ADDER_H #define ADDER_H class Adder { int op1, op2; public: Adder(int a, int b); int process(); }; #endif #pragma once # Adder.cpp #include "Adder.h" Adder::Adder(int a, int b) { op1 = a; op2 = b; } int Adder::process() { return op1 + op2; } # Calculator.h #ifndef CALCULATOR_H #define CALCULATOR_H class Calculator { public: void run(); }; #endif #pragma once # Calculator.cpp #i..
# Circle.h #ifndef CIRCLE_H #define CIRCLE_H class Circle { private: int radius; public: Circle(); Circle(int r); double getArea(); }; #endif # Circle.cpp #include using namespace std; #include "Circle.h" Circle::Circle() { radius = 1; cout
#include using namespace std; class Rectangle { private: int width, height; public: Rectangle(int w, int h); int getArea(); }; Rectangle::Rectangle(int w, int h) : width(w), height(h) {} int Rectangle::getArea() { return width * height; } int main() { int x, y; cout > x >> y; Rectangle rect(x,y); cout
#include #include int main() { int n=1,l=1,h=100,m; char b; do { m=(l+h)/2; printf("당신이 생각하고 있는 숫자가 %d입니까?",m); scanf("\n"); scanf("%c",&b); if(b=='y' || b=='Y') { printf("%d번 만에 맞춤!\n",n); break; } else if(b=='L' || b=='l') { l=m+1; } else if(b=='H' || b=='h') { h=m-1; } n++; printf("그럼 "); }while(l
#include int main() { int n,k,i,j,sum,s=0; printf("선택(1,2,3) = "); scanf("%d", &n); if (n == 3) return 0; printf("반복횟수 = "); scanf("%d", &k); if (n == 1) { for (i = 1; i 1) { s -= sum; } } printf("총합 = %d\n", s+1); } else if (n == 2) { for (i = 1; i 1) { s -= sum; } } printf("총합 = %d\n", s+1); } return 0; }
#include #include int main() { int i,j,n,a[10][10],k=1,p,m; do { printf("input = "); scanf("%d",&n); if(n==0) return 0; }while(n>=10); m=n; if(n%2==1) { i=0,j=-1,k=1; while(1) { for(p=0;p
#include #include int main() { int i=0,j=0,I=0,J=0,n,a[10][10],k,p; scanf("%d",&n); k=n; for(p=0;p
#include #include int main() { int n,i,j,a[10][10]={0},sum; char c; do { do { printf("n = "); scanf("%d",&n); }while(n7); a[1][1]=1; sum=1; for(i=2;i
#include #include int main() { int i,j,n,a[10][10],k=1,p,m,s=1; do { printf("input = "); scanf("%d",&n); if(n==0) return 0; }while(n>=10); m=n; if(n%2==1) { i=0,j=-1,k=1; while(1) { for(p=0;p
#include #include int main() { int i,j,sum,avg,k,t,a[9]={90,10,30,50,20,40,60,70,80}; do { sum=0; for(i=0;i
#include #include int arr[100000]; void F(int a, int *sum, int *cnt) { int i, c=0, hap=0; for(i=1;i
#include #include int main() { int m,n,t,i,j,k=0; char c; do { do { printf("m, n ? "); scanf("%d %d",&m,&n); if(m==0&&n==0) return 0; }while(m==0||n==0||m>100||n>100||m==n); if(m>n) { t=m; m=n; n=t; } k=0; if(m