简单来讲,昨天摆了,处理了点杂事。今天继续写,感觉今天能写好久代码,很开心,考试提前了,现在还有一个月时间去复习,要赶快了。
一、抄1.c primer plus P63 4.2.2使用字符串
#include# define PRAISE "You are an extraordinary being" int main() { char name[40]; printf("What is your name"); scanf("%s",name); printf("Hello,%s.%ssn", name,PRAISE); return 0; }
ABD ABC的话,scanf'仅读取了ABD ABC中的ABD
根据%s的转换说明,scanf()只会读取字符串的一个单词。
2.
#include#define PAGES 996 int main() { printf("*%d*n",PAGES); printf("*%2d*n",PAGES); printf("*%10d*n",PAGES); printf("*%-10d*n",PAGES); return 0; }
运行结果
二、写今天没写,课有点多。



