摘要:
8.4 guess.c 一个拖沓且错误的猜数字程序 include int main(void) { int guess = 1; printf("Pick an integer from 1 to 100. I will try to guess "); printf("it. \nRespond 阅读全文
posted @ 2019-05-07 23:23
viviLy
阅读(174)
评论(0)
推荐(0)
摘要:
8.3 file_eof.c 打开一个文件并显示该文件 include include // 为了使用exit() int main() { int ch; FILE fp; char fname[50]; // 存储文件名 printf("Enter the name of the file: " 阅读全文
posted @ 2019-05-07 23:22
viviLy
阅读(245)
评论(0)
推荐(0)
摘要:
8.1 echo.c 重复 输入 include int main(void) { char ch; while ((ch = getchar()) != ' ') putchar(ch); return 0; } 阅读全文
posted @ 2019-05-07 23:21
viviLy
阅读(145)
评论(0)
推荐(0)
摘要:
echo_eof.c 重复输入,直到文件结尾 include int main(void) { int ch; while ((ch = getchar()) != EOF) // Ctrl + Z 结束符 putchar(ch); return 0; } 阅读全文
posted @ 2019-05-07 23:21
viviLy
阅读(264)
评论(0)
推荐(0)