KakaoTalk_20190606_001802318.png
  • 246x0w
Welcome
Curriculum
Install&Go
Board
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
  • 카테고리
  • 전체 게시물
  • 내 게시물
이재민
2020년 7월 28일

200728

게시판: 소스 코드 제출

/*


#include <iostream>

#include <string>

using namespace std;


class au2

{

public:

static int* concat(int s1[],int s2[],int size)

{

for (int i=0; i<size; i++)

{

cout << s1[i] << ' ';

}


for (int i=0; i<size; i++)

{

cout << s2[i] << ' ';

}

cout << endl;

}

static int *remove(int s1[],int s2[],int size,int &retsize)

{

for (int i=0; i<size; i++)

{

for (int j=0; j<size; j++)

{

if (s1[i]==s2[j])

{

s1[i]=0;

}

}

}

for (int i=0; i<retsize; i++)

{

if (s1[i]!=0)

{

cout << s1[i] << ' ';

}

}


}

};


int main()

{

int cnt=0;

int x[5];

int y[5];

for (int i=0; i<5; i++)

{

cin >> x[i];

}

for (int i=0; i<5; i++)

{

cin >> y[i];

}


au2::concat(x,y,5);


for (int i=0; i<5; i++)

{

for (int j=0; j<5; j++)

{

if (x[i]==y[j])

{

cnt++;

}

}

}

int k;

k=5-cnt;

cout << k << endl;

au2::remove(x,y,5,k);



}

*/

























/*

#include <iostream>

#include <cstdlib>

#include <ctime>

using namespace std;


class rd

{

public:

static void seed()

{

srand((unsigned)time(0));

}

static int nextint(int min=0,int max=-32767)

{

int k;

for (int i=0; i<10; i++)

{

k= rand()%100+1;

}

return k;


}

static char nextalphabet()

{

char s;

for (int i=0; i<10; i++)

{

s=rand()%26+96+1;

}

return s;


}

static double nextdouble()

{

int k;

for (int i=0; i<10; i++)

{

k=rand()%100000;


}

return (double)k/1000000;


}

};


int main()

{

cout << "1~100 랜덤정수"<<endl;

rd::seed();

for (int i=0; i<10; i++)

{

cout << rd::nextint(1,100) << ' ';

}

cout << endl;

cout << "알파벳 랜덤 출력"<<endl;

rd::seed();

for (int i=0; i<10; i++)

{

cout << rd::nextalphabet() << ' ';

}

cout << endl;

cout << "랜덤 실수 출력"<< endl;

rd::seed();

for (int i=0; i<10; i++)

{

cout << rd::nextdouble() << ' ';

}



}

*/

































#include <iostream>

#include <string>

using namespace std;


class trace

{

public:

static void put(string a,string b=)

{

cout << a <<':'<< b <<endl;

}

static void print(string c)

{

cout << c << "정보 출력"<<endl;


}

};


void f()

{

int a,b,c;

cout << "두개정수입력";

cin >> a >> b;

trace::put("f()","정수입력받음");

c=a+b;

trace::put("f()","합 계산");

cout << "합은 "<<c <<endl;

}


int main()

{

trace::put("main()","프로그램 시작합니다");

f();

trace::put("main()","종료");

trace::put("f()");

trace::print();

}


댓글 0개
0
댓글
댓글 0개
유사 게시물
  • 200728
  • 200728
  • 200728
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호