From 11e99475eb665b270174a4bcc28c96414c4da8ca Mon Sep 17 00:00:00 2001 From: wandoubaba517 Date: Tue, 5 Dec 2023 20:53:38 +0800 Subject: [PATCH] width.c --- c04_string/width.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 c04_string/width.c diff --git a/c04_string/width.c b/c04_string/width.c new file mode 100644 index 0000000..af7be68 --- /dev/null +++ b/c04_string/width.c @@ -0,0 +1,14 @@ +/* width.c - 字段宽度 */ +#include + +#define PAGES 959 + +int main(void) +{ + printf("*%d*\n", PAGES); + printf("*%2d*\n", PAGES); + printf("*%10d*\n", PAGES); + printf("*%-10d*\n", PAGES); + + return 0; +} \ No newline at end of file