이산수학
- 최초 등록일
- 2010.12.31
- 최종 저작일
- 2010.12
- 13페이지/ 한컴오피스
- 가격 1,000원
소개글
이산수학
목차
1. 로또 번호 출력하기
2. HIV 바이러스 찾기
3. 통신판매
본문내용
이산수학
1. 로또 번호 출력하기
가. 소스
#include
#include
using namespace std
int lotto[6] = {0};
int lotto_cnt = 0;
int random(){
rand:
int tmp
while(1){
tmp = rand() % 45 + 1;
for(int i = 0; i < lotto_cnt i++)
if(tmp == lotto[i])
goto rand
break
}
lotto[lotto_cnt++] = tmp
return tmp
}
void max_six(int * prob){
int max = 0, i, j, k = 0;
cout << endl << "lotto number : "
for(j = 0; j < 6; j++)
{
for(i = 1; i < 46; i++)
{
if(max < prob[i])
{
max = prob[i];
k = i
참고 자료
없음