小编Zen*_*ter的帖子

C中的Scanf/Printf ......这里发生了什么?

我是自学C,目前正在研究Scanf和Printf函数.

我调整了这个程序来测试自己:

char topping[24];
int slices;
int  day, year;
float cost;
char month[10];

printf(" How much does a pizza cost in your area?\n");
printf("$");
scanf(" %f", &cost);

printf("What is your favorite one-word pizza topping?\n");
scanf(" %s",topping);
printf("How many slices of %s pizza, topping can you eat in one sitting\n",topping);
scanf(" %d", &slices);

printf(" What is today's date (enter in the following format 1-Jan-2016 )\n");
scanf(" %d-%s-%d", &day, month, &year);
printf("\nWhy not treat yourself to dinner on %d-%s-%d and have %d …
Run Code Online (Sandbox Code Playgroud)

c arrays variables printf scanf

2
推荐指数
1
解决办法
197
查看次数

标签 统计

arrays ×1

c ×1

printf ×1

scanf ×1

variables ×1