\#include<stdio.h>
?
 \#include<string.h>  *//提供strlen()函数原型*
?
 \#define DENSITY 62.4  *//人体密度*
?
 \#include<windows.h>
?
 int main()
?
 {
?
   float weight,volume;
?
   int size,letters;
?
   char name[40];  *//name是一个可以容纳40个字符的数组*
?
   printf("Hi!What‘s your first name?\n");
?
   scanf("%s",&name);
?
   printf("%s,What‘s your weight in pounds?\n");
?
   scanf("%f",&weight);
?
   size = sizeof(name);
?
   letters = strlen(name);
?
   volume = weight/DENSITY;
?
   printf("Well,%s,your volume is %2.2f cubic feet.\n",name,volume);
?
   printf("Also,your first name has %d letters.\n",letters);
?
   printf("And we have %d bytes to store it.\n",size);
?
   getchar();
?
   system("pause");
?
   return 0 ;
?
?
?
 }
 
 
 
字符串:一个或多个字符序列
双引号表示字符串
字符串以“\0”结尾
字符数组用“[]”表示
strlen()函数用于获取字符串长度
sizeof()运算符
格式化输出:printf()函数
数据打印的转换说明符
printf()的待打印列表
printf()的转换说明修饰
printf()的标记
打印过程中的数据转换
printf()的返回值
格式化输入:scanf()函数
scanf()的参数
常量和变量
#define预处理命令
符号常量
明示常量
limits.h
float.h
原文:https://www.cnblogs.com/jyyofficial/p/14731441.html