수다닷컴

  • 해외여행
    • 괌
    • 태국
    • 유럽
    • 일본
    • 필리핀
    • 미국
    • 중국
    • 기타여행
    • 싱가폴
  • 건강
    • 다이어트
    • 당뇨
    • 헬스
    • 건강음식
    • 건강기타
  • 컴퓨터
    • 프로그램 개발일반
    • C언어
    • 비주얼베이직
  • 결혼생활
    • 출산/육아
    • 결혼준비
    • 엄마이야기방
  • 일상생활
    • 면접
    • 취업
    • 진로선택
  • 교육
    • 교육일반
    • 아이교육
    • 토익
    • 해외연수
    • 영어
  • 취미생활
    • 음악
    • 자전거
    • 수영
    • 바이크
    • 축구
  • 기타
    • 강아지
    • 제주도여행
    • 국내여행
    • 기타일상
    • 애플
    • 휴대폰관련
  • 프로그램 개발일반
  • C언어
  • 비주얼베이직

빙고게임(빙고 체크)

타키

2023.04.01

질문 제목 : 빙고게임 (빙고 체크)1빙고부터 5빙고까지를 체크하는 부분과 입력받은 수를 99대신 ★로 바꾸는 부분질문 내용 :c언어를 배운지3개월 되가는데요 빙고를 주제로 잡고 프로젝트를 하던 도중
1) 1빙고부터 5빙고까지 체크하는부분
2) 입력받은 숫자를 문자로 바꾸는 부분
이 두가지를 실행시키려고하는데 자꾸 오류가나서 조언부탁드립니다.

소스------------------------------------------------

#include stdio.h
#include stdlib.h
#include time.h
#include windows.h
#include conio.h

#define n 25
void textcolor(int color_number); //text color
void print_map(int user1[n], int user2[n]);

int main ()
{
file *fp;
srand((unsigned)time(0));
int user1[25],user2[25];
int count=0, count1=0;
int i,j,k,h,l=0, num1,num2;
int g,m,count2=0,count3=0;
char buf;
char *file_name = test.txt;
int str1[6][6],a,b,c=0;
int str2[6][6],d,e,f=0;

system(color f0);

sleep(500);

beep(1318,750);
beep(1318,250);
beep(1318,250);
beep(1396,250);
beep(1318,250);
beep(1174,250);

beep(1046,250);
beep(932,250);
beep(880,250);
beep(932,250);
beep(783,750);
beep(783,250);

beep(1046,1000);

fp = fopen(file_name, r);
if(fp == null)
{
printf(%s 파일을 열지 못했습니다.\n, file_name);
exit(1);
}
while( (buf=getc(fp)) != eof )
{
putchar(buf);
}
fclose(fp);

for(i=0;i25;i25;i++)
user1[i]=i;

while(count100)
{
int c1,c2,temp;
c1=rand()%25;
c2=rand()%25;
temp=user1[c1];
user1[c1]=user1[c2];
user1[c2]=temp;
count++;
}

for(j=0;j25;j++)
user2[j]=j;

while(count1100)
{
int c1,c2,temp;
c1=rand()%25;
c2=rand()%25;
temp=user2[c1];
user2[c1]=user2[c2];
user2[c2]=temp;
count1++;
}
sleep(700);
system(cls);

for(b=0; b5; b++)
{
for(a=0; a 5; a++)
{
str1[a][b-1]=user1[c];
c++;
}
}

for(d=0; d5; d++)
{
for(e=0; e5; e++)
{
str2[e-1][d]=user2[f];
f++;
}
}

print_map(user1,user2);

for(l=0; l=1000; l++)
{
printf(user1의 숫자를 입력하세요 :);
scanf(%d, &num1);
for(k=0; k=24; k++)
{
if(user1[k] == num1)
{
user1[k] = 99;
}
}
printf(user2의 숫자를 입력하세요 :);
scanf(%d, &num2);

for(h=0; h=24; h++)
{
if(user2[h] == num2)
user2[h] = 99;
}

sleep(500);
system(cls);

print_map(user1,user2);
}
getch();
return 0;
}

void print_map(int user1[n], int user2[n])
{
printf(┏━┳━┳━┳━┳━┓ ┏━┳━┳━┳━┳━┓\n);
printf(┃%2d┃┃%2d┃%2d┃%2d┃%2d┃%2d┃ ┃%2d┃%2d┃%2d┃%2d┃%2d┃\n, user1[1],user1[2],user1[3],user1[4],user1[5],user2[1],user2[2],user2[3],user2[4],user2[5]);
printf(┣━╋━╋━╋━╋━┫ ┣━╋━╋━╋━╋━┫\n);
printf(┃%2d┃%2d┃%2d┃%2d┃%2d┃ ┃%2d┃%2d┃%2d┃%2d┃%2d┃\n, user1[6],user1[7],user1[8],user1[9],user1[10], user2[6],user2[7],user2[8],user2[9],user2[10]);
printf(┣━╋━╋━╋━╋━┫ ┣━╋━╋━╋━╋━┫\n);
printf(┃%2d┃%2d┃%2d┃%2d┃%2d┃ ┃%2d┃%2d┃%2d┃%2d┃%2d┃\n, user1[11],user1[12],user1[13],user1[14],user1[15], user2[11],user2[12],user2[13],user2[14],user2[15]);
printf(┣━╋━╋━╋━╋━┫ ┣━╋━╋━╋━╋━┫\n);
printf(┃%2d┃%2d┃%2d┃%2d┃%2d┃ ┃%2d┃%2d┃%2d┃%2d┃%2d┃\n, user1[16],user1[17],user1[18],user1[19],user1[20],user2[16],user2[17],user2[18],user2[19],user2[20]);
printf(┣━╋━╋━╋━╋━┫ ┣━╋━╋━╋━╋━┫\n);
printf(┃%2d┃%2d┃%2d┃%2d┃%2d┃ ┃%2d┃%2d┃%2d┃%2d┃%2d┃\n, user1[21],user1[22],user1[23],user1[24],user1[0],user2[21],user2[22],user2[23],user2[24],user2[0]);
printf(┗━┻━┻━┻━┻━┛ ┗━┻━┻━┻━┻━┛\n);
}

신청하기





COMMENT

댓글을 입력해주세요. 비속어와 욕설은 삼가해주세요.

번호 제 목 글쓴이 날짜
2700400 원넓이를 계산이요 ㅜㅜ 천칭자리 2025-07-04
2700368 if에 관해서 질문이요... Orange 2025-07-04
2700339 이거 결과값이 왜이런건지.. (4) 그댸와나 2025-07-04
2700313 파일 읽어서 저장하는데 빈파일일 경우 문재가 발생하네요.. (2) 크나 2025-07-03
2700287 구조체 동적할당 연습을 하는데 오류가 뜹니다...(해결) (3) 아련나래 2025-07-03
2700264 문자와 숫자 동시에 입력??? 글고운 2025-07-03
2700236 txt파일로만 쓰고 읽게 하려면 어떻게 해야 하나요..?? (8) 미국녀 2025-07-03
2700211 전위 연산자 (2) 어른처럼 2025-07-02
2700183 C에서 파일이름을 받고, 그 파일의 사이즈를 출력해줘야하는데 내용이 출력이 안되네요 ;ㅅ; 피스케스 2025-07-02
2700150 꼭좀 도와주세요ㅠㅠㅠ 호습다 2025-07-02
2700095 연산문제...질문... 오빤테앵겨 2025-07-01
2700070 while문 , 3의배수 출력하는 프로그램좀 짜주세욤. 횃불 2025-07-01
2700041 초보인데요 ㅎ 배열안에 배열을 집어넣을수 있나요?? 헛장사 2025-07-01
2700012 배열// (1) 전갈자리 2025-07-01
2699895 무한루프에 빠집니다.!! 해결좀부탁드려요 (10) 선아 2025-06-30
2699842 질문을 너무 많이 하네여.....죄송.... (2) 해님꽃 2025-06-29
2699816 오류 질문입니다.. (1) 해비치 2025-06-29
2699763 질문입니다 ! 꼭 좀 도와주세요ㅠㅠ (2) 미라 2025-06-28
2699555 c언어 다항식을 입력을 했는데 왜 출력이 안될까요? 피스케스 2025-06-27
2699528 C언어 포인터연산 질문입니다. (3) 안녕나야 2025-06-26
<<  이전  1 2 3 4 5 6 7 8 9 10  다음  >>

수다닷컴 | 여러분과 함께하는 수다토크 커뮤니티 수다닷컴에 오신것을 환영합니다.
사업자등록번호 : 117-07-92748 상호 : 진달래여행사 대표자 : 명현재 서울시 강서구 방화동 890번지 푸르지오 107동 306호
copyright 2011 게시글 삭제 및 기타 문의 : clairacademy@naver.com