谁能帮我设计一个使用C语言库函数的简单程序

来源:百度知道 编辑:UC知道 时间:2024/05/26 20:33:56
利用五个常用函数编写一段程序,使用的函数不限,完成的功能也不限。

#include <stdio.h>
#include <string.h>
void main()
{
char a[] = "hello";
char b[100];
memset(b, 0, sizeof(b));
strcpy(b, a);
strcat(b, "world!");
printf("%s\n", b);
}
5个函数,memset,sizeof,strcpy,strcat,printf,个个常用。

。。。汗 这个随便都有的找啊

从键盘上输入字符串"This is a example.",然后将其输出。#include <stdio.h>
#include <string.h>
#include <conio.h>
#define N 20
void main ()
{ char cstr[N] ;
clrscr () ;
printf ( "Please input the string (less than %d characters) :\n" , N ) ;
gets ( cstr ) ;
printf ( "The string is: ");
puts ( cstr ) ;
}
输入五个国家的名称,然后按字母顺序排列输出。
#include <stdio.h>
#include <string.h>
#include <conio.h>
#define N 5
#define M 20
void main ()
{
char cst[M] , cs[N][M] ;
int ictr , ictr1