#include <stdio.h>
struct addr{
char name[10];
int age;
};
int main(void)
{
struct addr m1;
int put,pput;
char GirlFull[300];
char NotGirlFull[300];
char indis[300];
FILE *in;
FILE *FGirlFull;
FILE *FNotGirlFull;
FILE *Fdisplay;
FILE *dis;
in=fopen("in.txt","w");
FGirlFull=fopen("GirlFull.txt","r");
FNotGirlFull=fopen("NotGirlFull.txt","r");
Fdisplay=fopen("display.txt","a");
dis=fopen("display.txt","r");
printf("부끄부끄 Test !! Ver 1.0 \n 무단 수정 및 재배포 대환영 \n");
printf(" 코드 작성자 E-Mail : \n");
while(put!=5)
{
printf("프로그램 시작 1. Test 명단 확인 2. 프로그램 종료 5.");
scanf("%d",&put);
switch(put)
{
case 1:
printf("시작에 앞서 인적사항 기록을 하겠습니다.\n");
printf("이름을 입력해 주십시오.\n");
scanf("%s",m1.name);
fputs(m1.name,in);
fputs(m1.name,Fdisplay);
printf("나이를 입력해 주십시오.\n");
scanf("%d",&m1.age);
printf("당신은 남자입니까 여자입니까? 1. 남자 2. 여자");
scanf("%d",&put);
switch(put)
{
case 1:
printf("당신은 믿음직한 대한의 건아 시군요!\n");
printf("당신은 이성친구가 많습니까? 1. 예 2. 아니오");
scanf("%d",&pput);
switch(pput)
{
case 1:
printf("당신은 카사노바 일수도 있겠는걸요?\n");
printf("그렇다면 당신은 이성친구가 편합니까? 1. 예 2. 아니오");
scanf("%d",&pput);
switch(pput)
{
case 1:
printf("이럴 수가.. 당신의 결과가 저장되었습니다");
fprintf(in,"%d ",m1.age);
fprintf(Fdisplay," %d 남자\n",m1.age);
fgets(GirlFull,300,FGirlFull);
fputs(GirlFull,in);
return 0;
case 2:
printf("이럴 수가.. 당신의 결과가 저장되었습니다");
fprintf(in,"%d ",m1.age);
fprintf(Fdisplay," %d 남자\n",m1.age);
fgets(NotGirlFull,300,FNotGirlFull);
fputs(NotGirlFull,in);
return 0;
default:
break;
}
case 2:
printf("아. 당신은 이성 친구가 별로 없군요\n");
printf("그렇다면 당신은 이성친구가 불편합니까? 1. 예 2. 아니오");
scanf("%d",&pput);
switch(pput)
{
case 1:
printf("이럴 수가.. 당신의 결과가 저장되었습니다");
fprintf(in,"%d ",m1.age);
fprintf(Fdisplay," %d 남자\n",m1.age);
fgets(NotGirlFull,300,FNotGirlFull);
fputs(NotGirlFull,in);
return 0;
case 2:
printf("이럴 수가.. 당신의 결과가 저장되었습니다");
fprintf(in,"%d ",m1.age);
fprintf(Fdisplay," %d 남자\n",m1.age);
fgets(GirlFull,300,FGirlFull);
fputs(GirlFull,in);
return 0;
default:
break;
}
}
case 2:
printf("여자는 우리반에 없어.Bye!");
fprintf(in,"%d 여자",m1.age);
fprintf(Fdisplay," %d 여자\n",m1.age);
return 0;
default:
printf("진지하게 눌러주시기 바랍니다.");
}
case 2:
fread(indis,300,1,dis);
puts(indis);
}
fclose(in);
fclose(GirlFull);
fclose(NotGirlFull);
fclose(Fdisplay);
fclose(dis);
}
return 0;
}
일단 안구 테러 죄송합니다. ㅠㅠ
아까 낮에 출력을 못해서 검색을 하고 책보면서 코딩한결과
fread(indis,300,1,dis);
puts(indis);
로 출력은 성공했는데
이런 고대 상형문자가 나옵니다.....
이유가 뭐죠 ????ㅠㅠ