CLearn/Chapter_4/4_6_printout.c

20 lines
589 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* 使用转换说明 */
#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有写 */