취미2009. 4. 5. 20:45
워크래프트III 시리즈에서는 플레이어의 게임 진행을 돕기 위하여 치트 코드를 지원하고 있습니다.
단, 치트 코드는 싱글 플레이(Single Play)에서만 적용이 되며, 배틀넷과 LAN 게임에서는 지원되지 않습니다.
 

치트 코드의 사용방법은 게임 진행 중 엔터키를 눌러 채팅모드로 변환 후 치트코드를 입력하면 해당 치트의 능력이 적용됩니다.
지나친 치트의 사용은 게임의 재미를 저하시키므로 필요 이상의 치트는 사용하지 않으시는 것이 좋습니다.

 

Cheat-Code 효 능
warpten 유닛과 건물들이 생산되는 시간을 빠르게 한다.
iocainepowder 시체가 없어지는 시간을 빠르게 한다.
whosyourdaddy 무적 모드
keysersoze [값] 지정한 값 만큼 금을 늘린다.
leafittome [값] 지정한 값 만큼 나무를 늘린다.
greedisgood 금과 나무가 기본값으로는 500씩 증가하고 뒤에 값을 입력해주면
그만큼 올라갑니다.
pointbreak 식량의 제한을 없앤다. 식량건물이 없더라도 유닛 생산이 가능해진다.
thereisnospoon 마나의 제한을 없앤다. 마법 사용시 마나가 줄지 않는다.
strengthandhonor 패배하지 않는다. 미션을 실패하더라도 게임이 끝나지 않는다.
motherland [race] [Level] 원하는 종족의 레벨로 이동한다.
MotherLand orc 05 : 오크 종족의 5번째 캠페인으로 이동한다.
somebodysetupusthebomb 무조건 패배한다.
allyourbasearebelongtous 무조건 승리한다.
whoisjohngalt 업그레이드의 속도를 빠르게 한다.
sharpandshiny 모든 업그레이드를 한단계 업그레이드 시킨다.
iseedeadpeople 현재 지도에 표시되어 있는 검은 안개를 모두 제거한다.
synergy 건물 건설시 상관관계에 따른 테크트리를 무시하게 한다.
riseandshine 게임 내의 시간을 낮으로 바꾼다.
lightsout 게임 내의 시간을 밤으로 바꾼다.
daylightsavings [시간] 게임 내의 시간을 원하는 시간으로 설정한다.



추후 추가되는 Cheat-Code 는 확인 후 지속적으로 추가 됩니다.  이건 뻥!! 치트키 이게 전부






가끔 하는거라 나중에 필요 할거 같아서 ㅋ

출처 : http://frozenthrone.co.kr/            프로즌쓰론 공식 사이트


Posted by 샤키
유머2009. 4. 3. 14:32




오호 센스 있어 ㅋ

출처 : 루리웹
Posted by 샤키
유머2009. 4. 3. 14:30


마지막이 압권 !! ㅋ


출처 : 루리웹

Posted by 샤키
C/C++2009. 3. 31. 20:25

#include <turboc.h>
#define MAX 10


struct BOOM {
 int map;
 int block;
 int flag;
};


int Clear_Check(struct BOOM boom[MAX][MAX],int Boom_Check){
 int Count = 0;
 int i,j;
 for(i=0;i<MAX;i++){
  for(j=0;j<MAX;j++){

   if(boom[i][j].block == 1)
    Count++;   
  }
 }
 gotoxy(0,MAX+1);
 printf("Block_Count = %d \n",Count);

 if( ( Count == ((MAX-2)*(MAX-2) - MAX) ) && Boom_Check == MAX){
  return 1; // 참
 }else{
  return 0; // 거짓


 }
}

 

int  Check_Count(struct BOOM boom[MAX][MAX],int i,int j){
 int Count =0;
 int x,y;

 


 for(x=-1;x<=1;x++){
  for(y=-1;y<=1;y++){   
   if(boom[i+x][j+y].map == 10){
    Count++;


   }
  }
 }


 return Count;
}
void Print_MAP(struct BOOM boom[MAX][MAX]){
 int i,j;
 gotoxy(0,0);
 for(i=0;i<MAX;i++){
  for(j=0;j<MAX;j++){
   if(boom[i][j].block == 0){
    switch(boom[i][j].map){
    case 9:
     textcolor(15);
     printf("▧");
     break;
    default:
     textcolor(2);
     printf("□");
     break;


    }
   }else{
     switch(boom[i][j].map){
    case 0:
     printf("  ");
     break;
    case 1:
     textcolor(11);
     printf("①");
     break;
    case 2:
     textcolor(14);
     printf("②");
     break;
    case 3:
     textcolor(13);
     printf("③");
     break;
    case 4:
     textcolor(8);
     printf("④");
     break;
    case 5:
     textcolor(9);
     printf("⑤");
     break;
    case 9:
     textcolor(15);
     printf("▧");
     break;
    case 10:
     textcolor(RED);
     printf("※");
     break;


     }
    }
    if(boom[i][j].block == 0 && boom[i][j].flag == 1 ){
     textcolor(BLUE);
     printf("\b\b▶");
    }

 


   }


  


   printf("\n");
  }


}

 

 


int main(){


 struct BOOM boom[MAX][MAX];


 int i,j;
 int x,y;
 int X,Y;
 char ch;
 int Boom_Check=0;


 for(i=0;i<MAX;i++){
  for(j=0;j<MAX;j++){
   if(i==0||j==0|| i == MAX-1 || j == MAX-1){
    boom[i][j].map = 9;
   }else{
    boom[i][j].map = 0;
    boom[i][j].block = 0;
    boom[i][j].flag = 0;
   }
  }
 }

 


 //지뢰 심기
 for(i=0;i<MAX;i++){
  x = baserand(1,MAX-2);
  y = baserand(1,MAX-2);
  if(boom[x][y].map != 10){
   boom[x][y].map = 10;
  }else{
   i--;
   continue;
  }


 }
 //Count 세기

 


 for(i=1;i<MAX-1;i++){
  for(j=1;j<MAX-1;j++){
   if(boom[i][j].map != 10){
    boom[i][j].map = Check_Count(boom,i,j);


   }


  }
 }


 X = Y = 2;


 Print_MAP(boom);


 while(1){
  gotoxy(0,MAX+3);
  printf("  X = %2d , Y = %2d \n",X,Y);
  printf("  Count = %2d \n",boom[Y][X].map);
  printf("  Boom Check = %2d\n",Boom_Check);


  gotoxy(X*2,Y);
  ch = getch();


  switch(ch){
   case UP:
    if(Y!=1)Y--;
    break;
   case DOWN:
    if(Y!=MAX-2)Y++;
    break;
   case LEFT:
    if(X!=1)X--;
    break;
   case RIGHT:
    if(X!=MAX-2)X++;
    break;
   case 'f':


    if(boom[Y][X].block == 0){


     if(boom[Y][X].flag == 1){
     
      boom[Y][X].flag = 0;


      if(boom[Y][X].map == 10){
       Boom_Check--;
      }


     }else{
    
      boom[Y][X].flag = 1;


      if(boom[Y][X].map == 10){
       Boom_Check++;
      }


     }
    }
   

 

 


    break;


   case ' ':


    boom[Y][X].block = 1;
    if(boom[Y][X].map == 10){
     gotoxy(0,MAX+6);
     textcolor(WHITE);


     for(i=0;i<MAX;i++){
      for(j=0;j<MAX;j++){
       if(boom[i][j].map==10){
        boom[i][j].block = 1;
       }


      }


     }


     Print_MAP(boom);


     printf("지뢰를 밟았습니다 \n");     
     printf("게임을 끝내겠습니다...\n");
     return 0;
    }
    break;


  }

 


  Print_MAP(boom);


  if(Clear_Check(boom,Boom_Check/*클리어 조건*/) == 1 ){

 

 

   gotoxy(0,MAX+7);
   printf("게임을 클리어 하셨습니다 \n");
   printf("수고하셨습니다 ^^ \n");
   break;
  }


 }
  return 0;
 }


아직 구현할게 남았고...  

쌤 ver.이다  

어렵다....

Posted by 샤키
C/C++2009. 3. 31. 20:23
/*
#include <stdio.h>
#include <time.h>
int main(){
 time_t t;
 time(&t);
 printf("숫 자 : %d \n",t);
 printf("문 자 : %s \n",ctime(&t));
 
 return 0;
}
*/
/*
#include <stdio.h>
#include <time.h>
int main(){
 char date[10];
 char time[10];
 _strdate(date);
 _strtime(time);
 printf("날 짜 : %s \n",date);
 printf("시 간 : %s \n\n",time);
 printf("시: %c%c \n",time[0],time[1]);
 printf("분: %c%c \n",time[3],time[4]);
 printf("초: %c%c \n\n",time[6],time[7]);
 printf("월: %c%c \n",date[0],date[1]);
 printf("일: %c%c \n",date[3],date[4]);
 printf("년: %c%c \n",date[6],date[7]);
 
 return 0;
}
*/
/*
#include <turboc.h>  //디지털 시계구현
int main(){
 time_t t;
 struct tm *pt;
 while(1){
  time(&t);
  pt=localtime(&t);    //현재시간
  printf("%d년 %d월 %d일 %d시 %d분 %d초 \r",
   1900+pt->tm_year,pt->tm_mon+1,pt->tm_mday,pt->tm_hour,pt->tm_min,pt->tm_sec);
  Sleep(1000);
  }
 return 0;
}
*/
/*
#include <turboc.h>  //세부적인 시간 구하기
#include <sys/timeb.h>
int main(){
 struct tm t;
 struct _timeb tb;
 while(1){  
  if(kbhit()){
  _ftime(&tb);
  t=*localtime(&tb.time);    //현재시간  
  printf("%d년 %d월 %d일 %d시 %d분 %d.%d \r",
   1900+t.tm_year,t.tm_mon+1,t.tm_mday,t.tm_hour,t.tm_min,t.tm_sec,tb.millitm);  
  Sleep(10);    
  getch();
   printf("\n");
 }
 } 
 
 return 0;
}
*/
/*
#include <turboc.h>   //D-day 프로그램
#define DAYSEC (24*60*60)
 void input(struct tm * in_time){
 printf("년도 : ");
 scanf("%d",&(in_time->tm_year));
 in_time->tm_year-=1900;
 printf("월 : ");
 scanf("%d",&(in_time->tm_mon));
 in_time->tm_mon-=1;
 printf("일 : ");
 scanf("%d",&(in_time->tm_mday));
}
int main(){
 time_t n1,n2;
 struct tm t1,t2 = {0,0,0,1,0,100}; //2000년 1월 1일     {1,0,100} 일 월 1900년
 int tmp;
 input(&t2);

 n1 = time(NULL);
 t1 = *localtime(&n1);
 n1 = mktime(&t1);
 n2 = mktime(&t2);
 n1 = n1 - n2;
 tmp = (int)(n1/DAYSEC);
 printf("%d년 %d월 %d일부터 지금까지\n",
  t2.tm_year+1900,t2.tm_mon+1,t2.tm_mday);
 if(mktime(&t1) > mktime(&t2)){
  printf("%d일 지났습니다.\n",tmp);
 }else{
  printf("%d일 남았습니다.\n",abs(tmp));
 }
 return 0;
}
*/


/*
#include <stdio.h>   //동적 할당예제
#include <stdlib.h>  //malloc함수 및 free 함수
int main(){
 int* int_p;        //↓sizeof(int) 해야
 int_p = (int *)malloc(4);  //heap영역에 4byte를 할당
 if(int_p==NULL){ //메모리 할당 실패 시 종료
  printf("메모리 할당 실패 \n");
  return 1;
 }
 *int_p = 100;
 printf("*int_p의 값은 : %d \n", *int_p);
 free(int_p);   //메모리 해제
 printf("*int_p의 값은(메모리 해제후) : %d \n", *int_p);
 
 return 0;
}
*/
/*
#include <stdio.h>
#include <stdlib.h>   //malloc함수 및 free 함수
int main(){
 int* int_ar;
 int i;
 int sel;
 printf("메모리를 할당할 공간 : ");
 scanf("%d",&sel);
 int_ar = (int*)malloc(sel*sizeof(int));
 for(i=0;i<sel;i++){
  int_ar[i] = (i+1)*2;
  printf("ar[%d] = %d \n", i, int_ar[i]);
 }
 free(int_ar);  //메모리 해제
 return 0;
}
*/
#include <stdio.h>
struct node {
 int Data;
 char Name[10];
 int Kor;
 int Eng;
 int Math;
};
int main(){
 struct node * tmp;
 int i;
 tmp = (struct node *)malloc( 5 * sizeof(struct node));
 for(i=0;i<5;i++){
  tmp[i].Data = 1001 + i;
  printf("ID : %d \n",tmp[i].Data);
  printf("이름 : ");
  fflush(stdin);
  scanf("%s",&tmp[i].Name);
  printf("국어 : ");  
  scanf("%s",&tmp[i].Kor);
 }
 

 for(i=0;i<5;i++){
  printf("%5d | %10s | 5d \n",tmp[i].Data,tmp[i].Name,tmp[i].Kor);
 }
 return 0;
}
Posted by 샤키
C/C++2009. 3. 30. 00:42

turboc.h 받아두는거 있지 말길

2009/03/30 - [C/C++] - UI (User Interface)  참고!!


/*
#include <turboc.h>        //Mapping

 

void Print_MAP(){
 int i,j;
 gotoxy(0,0);


 for(i=0;i<10;i++){
  for(j=0;j<10;j++){
   if(i==0 || j == 0 || i == 9 || j==9){
    textcolor(YELLOW);
    printf("■");


   }else{
    printf("  ");

   }
  }
  printf("\n");
 }
}

 


int main(){
 
 int x,y;
 
 int ch;


 x=y=3;
 system("mode con cols=22 lines=16");


 Print_MAP();


 while(1){
  gotoxy(0,13);
  textcolor(WHITE);
  printf("x = %d , y = %d \n",x,y);
  gotoxy(x,y);
  ch = getch();


  if(ch== 0xe0){ //
   ch = getch();
   switch(ch){
    case UP:
     if(y!=1)y--;
     break;
    case DOWN:
     if(y!=8)y++;
     break;
    case LEFT:
     if(x!=2)x--;
     break;
    case RIGHT:
     if(x!=17)x++;
     break;
   }
  }else{ // nomal key


   switch(ch){
    case 'q':
     gotoxy(0,15);
     return 0;
    case ' ':
     textcolor(baserand(0,10));
     printf("%c",baserand('A','Z'));
     break;
   }
  }
 }
 return 0;
}
*/

 

#include <turboc.h>


int main(){
 int i,j;


 int x,y;
 char ch;


 int MAP[10][10] = {
  {1,1,1,1,1,1,1,1,1,1,},
  {1,0,1,0,0,0,0,0,0,1,},
  {1,0,1,0,0,1,0,1,0,1,},
  {1,0,1,0,1,1,0,1,0,1,},
  {1,0,1,0,0,0,1,0,0,1,},
  {1,0,1,0,0,1,0,0,0,1,},
  {1,0,1,0,1,0,0,1,0,1,},
  {1,0,0,0,0,0,1,1,0,1,},
  {1,0,0,0,0,0,0,1,0,0,},
  {1,1,1,1,1,1,1,1,1,1,}
 };


 x = y = 1;
 gotoxy(0,0);
 for(i=0;i<10;i++){
  for(j=0;j<10;j++){
   if(MAP[i][j] == 1){
    printf("■");    
   }else if(MAP[i][j] == 2){
    printf("○");    
   }else{
    printf("  ");
   }
  }
  printf("\n");
 }
 MAP[x][y] = 2;


 while(1){


  gotoxy(0,13);
  printf("x = %d y = %d \n",x,y);

 


  gotoxy(0,0);
  for(j=0;j<10;j++){
   for(i=0;i<10;i++){
    if(MAP[i][j] == 1){
     printf("■");    
    }else if(MAP[i][j] == 2){
     printf("○");    
    }else{
     printf("  ");
    }
   }
   printf("\n");
  }

 

 


  ch = getch();


  switch(ch){


  case UP:
   if(MAP[x][y-1] == 0){
    MAP[x][y-1] = 2;
    MAP[x][y] = 0;
    y--;
   }
   break;
  case DOWN:
   if(MAP[x][y+1] == 0){
    MAP[x][y+1] = 2;
    MAP[x][y] = 0;
    y++;
   }
   break;
  case LEFT:
   if(MAP[x-1][y] == 0){
    MAP[x-1][y] = 2;
    MAP[x][y] = 0;
    x--;
   }
   break;
  case RIGHT:
   if(MAP[x+1][y] == 0){
    MAP[x+1][y] = 2;
    MAP[x][y] = 0;
    x++;
   }
   break;
  }

 


  if(x==8 && y == 9){
   printf("Game End... \n");
   break;


  }
 }
 return 0;
}

Posted by 샤키
C/C++2009. 3. 30. 00:39




/*
#include <turboc.h>

int main(){

gotoxy(37,12);   //turboc.h 헤더파일에 포함된

printf("Center");
gotoxy(0,24);

return 0;

}
*/

/*
#include <turboc.h>

int main(){

int x,y;
int i;


textcolor(9);         //색을 이렇게 사용 해도 된다.
printf("blue\n");
textcolor(RED);
printf("red\n");


//system("color FC");  //cmd창에서 색 넣기
while(1){ 
textcolor(baserand(0,15));
x = baserand(0,79);
y = baserand(0,24);
gotoxy(x,y);
printf("%c",baserand('0','9'));  
Sleep(10);       //점차 출력

}

return 0;
}
*/


/*
#include <turboc.h>

int main(){

int i;
int y;


system("mode con cols=70 lines=70");
while(1){
y = baserand(0,15);

for(i=0;i<65;i++){
gotoxy(i,y);        //오른쪽으로 이동
printf("바보");
Sleep(30);   //0.1초씩 멈추었다가
printf("\b\b\b\b    ");  
}

for(i=65;i>0;i--){
gotoxy(i,y);
printf("바보");
Sleep(30);
printf("\b\b\b\b    ");
}
}

return 0;
}
*/

/*
#include <turboc.h>

int main(){   //별떨어지는거

int y;
int x;

while(1){
x = baserand(0,40);

for(y=0;y<15;y++){
textcolor(baserand(1,15));
gotoxy(x,y);
printf("☆");
Sleep(70);
gotoxy(x,y);
printf("★");
}
for(y=0;y<15;y++){
gotoxy(x,y);
printf("  ");   
}
}

return 0;
}
*/

/*
#include <turboc.h>       //색 Reverse 방법

int main(){

 int i,j;
 int tmp;
 int A[16];


 for(i=0;i<16;i++){
  A[i] = 16 *i;
 }

 while(1){
  gotoxy(0,0);
  for(j=0;j<4;j++){
   for(i=0;i<16;i++){
    textcolor(A[i]);
    printf("  ");
   }
  }
  printf("\n");
  for(j=0;j<4;j++){
   for(i=15;i>=0;i--){
    textcolor(A[i]);
    printf("  ");
   }
  }
  tmp = A[0];
  for(i=0;i<15;i++){
   A[i] = A[i+1];
  }
  A[15] = tmp;
  Sleep(70);
 }
 printf("\n");

 return 0;

}
*/

/*
#include <turboc.h>       //별떨어지기 구조체를 사용
#define MAX 10


struct star{
 int x,y;
 int Speed;
 int tmp;
 int Color;
};


int main(){
 int i,j;
 struct star ST[MAX];
 for(i=0;i<MAX;i++){
  ST[i].x = baserand(0,50);
  ST[i].y = baserand(0,15);
  ST[i].Speed = baserand(0,10);
  ST[i].tmp = ST[i].Speed;
  ST[i].Color = baserand(1,15);
 }
 while(1){
  gotoxy(0,0);
  for(i=0;i<MAX;i++){
   gotoxy(ST[i].x,ST[i].y);
   textcolor(ST[i].Color);
   printf("★");
  }
  Sleep(10);
  
  for(i=0;i<MAX;i++){
   if(--ST[i].Speed ==0){
   gotoxy(ST[i].x,ST[i].y);
   printf("  ");
   ST[i].y++;
   if(ST[i].y == 16){
    ST[i].y = 0;
    ST[i].x = baserand(0,50);
   }
   ST[i].Speed = ST[i].tmp;
   }
  }
 }

 return 0;
}
*/

/*


Posted by 샤키
취미2009. 3. 29. 16:16


이거 찍은것은 한 3~4년전 되는데...  폴더 정리 하다가 ...  올려본다...

내 성격상 게임을 공략본 보면서 하는 타입이라...

많은 추억이 생각 나게 하는데...

그당시 어렵게 구한 공략본도 있고...  (이런 공략본은 지금은 어느정도 가치(?)가 더 올라갔겠지 ㅋㅋ)

저 당시 핵인 "게임 위자드 프로"도 보이고 ㅋ 이런 내가 샤키 메뉴얼이 빠졌네... 

언제 시간이 되면 여기 없는거 더 플러스 해서 올려 봐야겠다...
Posted by 샤키
C/C++2009. 3. 26. 22:04

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 10
#define FPATH "D:\\test.txt"


struct Student {     
 int ID;
 int Kor,Eng,Math;
 int Sum;
 float Avg;
 char name[12];
 char grand[3];
};

void Input_detail(struct Student ST[MAX], int i){
 printf("%d번째 학생의 ID : %d\n",i+1,ST[i].ID);
 printf("학생의 이름 : ");
 fflush(stdin);
 scanf("%s",&ST[i].name);
 printf("학생의 국어 성적 : ");
 scanf("%d",&ST[i].Kor);
 printf("학생의 영어 성적 : ");
 scanf("%d",&ST[i].Eng);
 printf("학생의 수학 성적 : ");
 scanf("%d",&ST[i].Math); 
 Avg(ST,i);
}
void Input(struct Student *ST){
 int i;
 for(i=0;i<MAX;i++){
  if(ST[i].ID == -1)break;
 }  
 ST[i].ID = 1001+i;
 Input_detail(ST,i);   
}

Avg(struct Student ST[MAX],int i){
 ST[i].Sum = ST[i].Kor + ST[i].Eng + ST[i].Math;
 ST[i].Avg = (float)ST[i].Sum/3;
 if(ST[i].Avg >= 90){
  strcpy(ST[i].grand,"수");
 }else if(ST[i].Avg >= 80){
  strcpy(ST[i].grand,"우");
 }else if(ST[i].Avg >= 70){
  strcpy(ST[i].grand,"미");
 }else if(ST[i].Avg >= 60){
  strcpy(ST[i].grand,"양");
 }else{
  strcpy(ST[i].grand,"가");   
 }
}

Print(struct Student ST[MAX],int i){
 printf("   ID |   이름 |  국어 |  영어 |  수학 |  합계 |  평균 |  등급\n"); 
 for(i=0;i<MAX;i++){
  if(ST[i].ID != -1){
   printf("%5d | %5s | %5d | %5d | %5d | %5d | %.2f | %5s\n",
    ST[i].ID,ST[i].name,ST[i].Kor,ST[i].Eng,ST[i].Math,ST[i].Sum,
    (float)ST[i].Avg,ST[i].grand);
  }
 }
}

void Sujung(struct Student ST[MAX], int i){
 int Sel; 
 printf(" 1. 수정 \n");
 printf(" 2. 삭제 \n");
 printf(" > ");
 fflush(stdin);
 scanf("%d",&Sel);
 printf(" %번째 학생: ");   //ID 선택으로 삭제를 하고 싶은데 도저히 모르겠다 ㅜㅜ
 fflush(stdin);
 scanf("%d",&i);
 i--;
 if(Sel==1){
  Input_detail(ST,i);
 }else if(Sel==2){ 
  ST[i].ID = -1;    //삭제는 -1 즉 작성되지 않은상태로 돌린다는 의미
 }else{
  printf("잘못입력 하셨습니다 \n");

 }
}


void Save(struct Student ST[MAX]){
 int i;
 FILE * f = fopen(FPATH,"w"); 
 for(i=0;i<MAX;i++){
  if(ST[i].ID != -1){
   fprintf(f,"%d  %s  %d  %d  %d\n",
    ST[i].ID,ST[i].name,ST[i].Kor,ST[i].Eng,ST[i].Math);
   printf("%d  %s  %d  %d  %d\n",
    ST[i].ID,ST[i].name,ST[i].Kor,ST[i].Eng,ST[i].Math);

  }else{
   fprintf(f,"-1\n");
  }
 }
 printf("이런 데이터를 저장 했습니다\n");
 fclose(f);
}

void Load(struct Student ST[MAX]){
 int i;
 FILE * f = fopen(FPATH,"r");
 for(i=0;i<MAX;i++){
  fscanf(f,"%d",&ST[i]);
  if(ST[i].ID != -1){
   fscanf(f,"%s %d %d %d",ST[i].name,&ST[i].Kor,&ST[i].Eng,&ST[i].Math);
   printf("%d  %s  %d  %d  %d\n",
    ST[i].ID,ST[i].name,ST[i].Kor,ST[i].Eng,ST[i].Math);

   Avg(ST,i);
  }
 }
 printf("이런 데이터를 읽어 왔습니다\n");
 fclose(f);
}

 

int main(){

 struct Student ST[MAX];
 int Select;
 int Sel;
 int i;

 


 for(i=0;i<MAX;i++){
  ST[i].ID = -1; //과연 이것도 이렇게 초기값이 될런지

 }


 while(1){
  system("cls");
  printf("==성적관리 프로그램==\n");
  printf(" 1. 입 력 \n");
  printf(" 2. 출 력 \n");
  printf(" 3. 수정 및 삭제 \n");
  printf(" 4. 저 장 \n");
  printf(" 5. 읽 기 \n");
  printf(" 6. 프로그램 종료 \n");
  scanf("%d",&Select);
  switch(Select){
   case 1:
    Input(ST);
    break;
   case 2:   
    Print(ST,i);
    break;
   case 3:
    Print(ST,i);
    Sujung(ST,i);   
    break;
   case 4:   
    Save(ST,i);
    break;
   case 5:   
    Load(ST,i);
    break;
   case 6:
    printf("프로그램을 종료하겠습니다 \n");
    return 0;
  }
  system("pause");

 

 }

 return 0;
}



기존에 성적관리 프로그램에 구조체와 입출력 기능(?)까지 모두 포함한 결정판(?) 이다

점점 기능이 좋아질수록 어렵다 ㅜㅜ

뭐 굳이 결정판이 아닐수도 또다른 기능이 추가 될수도...

그때 가서 다시 갱시하면 되는거고... ㅋ

Posted by 샤키
C/C++2009. 3. 26. 22:00
파일 입출력
⊙ 디스크에 있는 파일을 읽어오거나 저장하는것



/*

#include <stdio.h>
int main(){     //파일 저장

 char ar1[10] = "Apple! ";
 FILE * f = fopen("d:\\test.txt","w");
 puts(ar1);  //모니터에 출력
 fputs(ar1,f); //스트림을 통해 출력한다.
 fclose(f);  //꼭 닫아준다.

  return 0;
}
*/

/*
#include <stdio.h>

int main(){   //파일 열기

 char ar1[10] = "Empty!";
 FILE * f = fopen("d:\\test.txt","r");
 if(f==NULL){
  printf("파일을 열수 없습니다 \n");
  return 1;
 }
 puts(ar1);       //모니터에 출력
 fgets(ar1,sizeof(ar1),f);
 puts(ar1);
 fclose(f);
  return 0;
}
*/

/*
#include <stdio.h>   //fprintf 함수를 통해 구구단 파일 저장

int main(){

 int i,j;
 FILE * f = fopen("c:\\test.txt","w");
 for(i=1;i<10;i++){
  for(j=1;j<10;j++){
  fprintf(f,"%2d * %2d = %2d",i,j,i*j);
  if(!(j%1)){
   fprintf(f,"\n");
  }else{
   fprintf(f," // ");
  }
  }
  for(j=0;j<25;j++)fprintf(f,"-");
  fprintf(f, "\n");
 }
 fclose(f);
 return 0;
}
*/

 

#include <stdio.h>     //구구단 파일을 읽어와서 출력
#include <string.h>

int main(){

 char Read[100] = "\0";
 char String[10000] = "\0";
 int i,j;
 FILE * f = fopen("c:\\test.txt","r");
 while(!feof(f)){
  strcat(String,Read);
  fgets(Read,sizeof(Read),f);
         
 }
 puts(String);
 fclose(f);
 return 0;
}



Posted by 샤키