20 lines
589 B
C
20 lines
589 B
C
/* 使用转换说明 */
|
||
#include <stdio.h>
|
||
#define PI 3.141593
|
||
int main(void)
|
||
{
|
||
int number = 7;
|
||
float pies = 12.75;
|
||
int cost = 7800;
|
||
|
||
printf("The %d contestants ate %f berry pies.\n", number, pies);
|
||
printf("The value of pi is %f.\n",PI);
|
||
printf("Farewell! Thou art too dear for my possessing,\n");
|
||
printf("%c%d\n", '$', 2 * cost);
|
||
|
||
return 0;
|
||
}
|
||
/* printf 的转换说明修饰符有很多:标记、数字、.数字、
|
||
h、hh、j、l、ll、L、t、z,试试记住它们的意思*/
|
||
/* 标记也有很多种,比如:-、+、空格、#、0*,P84有写 */
|