C语言填空:strcpy功能实现

#include <stdio.h>
//将字符数组a的全部字符复制到字符数组b中(要求不用strcpy函数)
//并输出新字符串 1】
main()
{
    char a[100],b[100];
    int c,d,f;
    【2】;
    c=【3】;
    for(d=0;【4】;d++)
    b[d]=【5】;
    b[d]='\0';
    【6】;
    getchar();
 }
#include <stdio.h>
//将字符数组a的全部字符复制到字符数组b中(要求不用strcpy函数) 
//并输出新字符串 
#include <string.h>
main()
{
    char a[100],b[100];
    int c,d,f;
    gets(a);
    c=strlen(a);
    for(d=0;d<c;d++)
    b[d]=a[d];
    b[d]='\0';
    puts(b);
    getchar();
 }

 

posted @ 2023-02-12 15:12  myrj  阅读(22)  评论(0编辑  收藏  举报