기금넷 공식사이트 - 복권 조회 - c for 루프에 관한 질문입니다.
c for 루프에 관한 질문입니다.
이게 맞는지 확인해 보세요~
제가 이해한 내용이 맞다면 괜찮습니다:
#includelt;iostreamgt;
#include "time.h"
using 네임스페이스 std;
int main()
{
int ran [36] , teshu, num[6], temp;
const int max=36
srand((unsigned int)time(NULL))
teshu =rand()16 1;
for(int i=0;ilt;max;i)
ran[i]=rand()100 1;
p >for(int s=0; slt; max; s)
coutlt;lt;ran[s]lt;lt;"\t";
temp = 0;
int x, y, z;
for( y=0; ylt; 6; y )
{
for( x=0;xlt;max;x)
if(templt;ran[x])
{
temp=ran[x] ;
z=x;
}
숫자[y] = 온도;
실행[z] = 0;
p>
온도 = 0;
}
coutlt;lt;"\nnum= "lt;lt;num[0]lt;lt;" "lt;lt;번호[1]lt;lt;" "lt;lt;번호[3]lt;lt;" ]lt;lt ;" "lt;lt;번호[5];
}