// 函数
// int sprintf(char *str,const char* format,...)
// 头文件 #include<stdio.h>
// 参数:
// str -- 这是指向一个字符数组的指针,该数组存储了C字符串
// foramt --这是字符串,包含了要被写入到字符串str的文本。
// 它可以包含嵌入的 format 标签,format 标签可被随后的
// 附加参数中指定的值替换,并按需求进行格式化。
// format 标签属性是 %[flags][width][.precision][length]specifier
// 返回值:
// str指向的字符串的长度
#include <stdio.h>
#include <math.h>
int main()
{
char str[80];
sprintf(str,"PI 的值:%f",M_PI);
puts(str);
return 0;
}