prog1.c

来自「原始数据——网络技术」· C语言 代码 · 共 43 行

C
43
字号
#include <conio.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#define  N 81
void readwriteDAT();

void chg(char *s)
{



}

main( )
{
  char a[N];
  clrscr();
  printf("Enter a string : "); gets(a);
  printf("The original string is : "); puts(a);
  chg(a);
  printf("The string after modified : ");
  puts (a);
  readwriteDAT() ;
}

void readwriteDAT()
{
  int i ;
  char a[N] ;
  FILE *rf, *wf ;

  rf = fopen("in.dat", "r") ;
  wf = fopen("out.dat", "w") ;
  for(i = 0 ; i < 10 ; i++) {
    fscanf(rf, "%s", a) ;
    chg(a) ;
    fprintf(wf, "%s\n", a) ;
  }
  fclose(rf) ;
  fclose(wf) ;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?