Skip to content

Commit 4615d82

Browse files
author
hengxin
committed
revised to be concise
1 parent 150b57b commit 4615d82

File tree

7 files changed

+70
-57
lines changed

7 files changed

+70
-57
lines changed

tutorial/c-io/c-io.pdf

-45.3 KB
Binary file not shown.
7.95 KB
Loading

tutorial/c-io/figs/github-logo.png

29.3 KB
Loading

tutorial/c-io/figs/practice-text.png

80.4 KB
Loading

tutorial/c-io/figs/practice.jpg

62.2 KB
Loading

tutorial/c-io/sections/io.tex

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,52 @@ \section{IO}
77
\item a sequence of characters divided into lines
88
\item each line consists of $\ge 0$ characters followed by a newline character
99
\end{itemize}
10+
11+
\vspace{0.80cm}
12+
\centerline{\texttt{\#include <stdio.h>}}
1013
\end{frame}
1114
%%%%%%%%%%%%%%%
1215

1316
%%%%%%%%%%%%%%%
14-
\begin{frame}{Standard Input and Output: 以 \texttt{getchar}, \texttt{putchar} 为例}
15-
\centerline{代码示例: \texttt{file-copy.c}}
17+
\begin{frame}{字符输入输出: \texttt{getchar}, \texttt{putchar}}
18+
\begin{center}
19+
\href{http://www.cplusplus.com/reference/cstdio/getchar/}{\texttt{int \blue{getchar}(void);}} \\[8pt]
20+
\href{http://www.cplusplus.com/reference/cstdio/putchar/}{\texttt{int \blue{putchar}(int character);}}
21+
\end{center}
1622

1723
\vspace{0.50cm}
18-
\pause
19-
\href{http://www.cplusplus.com/reference/cstdio/EOF/}{EOF} (文件结束符):由宏定义的整型数
20-
\begin{itemize}
21-
\item EOF 是整型数 (\texttt{int c}; \texttt{!= EOF})
22-
\item EOF 不是实际字符, 不同于行结束符 ``\texttt{\textbackslash n}'' (\texttt{== '\textbackslash n'})
23-
\item EOF 不单单指示``文件''的结束, 而是指示字符流的结束
24-
\end{itemize}
24+
\centerline{代码示例: \texttt{file-copy.c}}
2525

2626
\pause
2727
\vspace{0.50cm}
28-
\centerline{代码运行:\texttt{./file-copy}}
28+
\centerline{代码运行:\texttt{gcc file-copy.c -o file-copy \;\; ./file-copy}}
2929

3030
\pause
31-
\vspace{0.30cm}
32-
\begin{columns}[c]
33-
\column{0.45\textwidth}
34-
\begin{description}[Windows]
35-
\item[Windows] \texttt{Ctrl + Z}
36-
\item[Linux] \texttt{Ctrl + D}
37-
\item[Mac] \texttt{Ctrl + D}
38-
\end{description}
39-
\column{0.45\textwidth}
40-
请仔细观察并思考:
41-
\begin{enumerate}
42-
\item \texttt{Enter} 的作用
43-
\item EOF 的作用
44-
\end{enumerate}
45-
\end{columns}
31+
\vspace{0.80cm}
32+
\centerline{代码运行:\texttt{./file-copy <file-copy-file} (OJ 测试用例)}
4633
\end{frame}
4734
%%%%%%%%%%%%%%%
4835

4936
%%%%%%%%%%%%%%%
50-
\begin{frame}{IO on OJ: input redirection (输入重定向)}
51-
\centerline{代码运行:\texttt{./file-copy <file-copy-file}}
37+
\begin{frame}{EOF}
38+
\href{http://www.cplusplus.com/reference/cstdio/EOF/}{EOF} (文件结束符):由宏定义的整型数
39+
\begin{itemize}
40+
\item EOF 是整型数 (\texttt{int c}; \texttt{!= EOF})
41+
\item EOF 不是实际字符, 不同于行结束符 ``\texttt{\textbackslash n}'' (\texttt{== '\textbackslash n'})
42+
\item EOF 不单单指示``文件''的结束, 而是指示字符流的结束
43+
\end{itemize}
44+
45+
\begin{description}[Windows]
46+
\item[Windows] \texttt{Ctrl + Z}
47+
\item[Linux] \texttt{Ctrl + D}
48+
\item[Mac] \texttt{Ctrl + D}
49+
\end{description}
5250
\end{frame}
5351
%%%%%%%%%%%%%%%
5452

5553
%%%%%%%%%%%%%%%
5654
\begin{frame}{格式化输出:\texttt{printf}}
57-
\centerline{\href{http://www.cplusplus.com/reference/cstdio/printf/}{\texttt{int printf(const char* format, ...);}}}
55+
\centerline{\href{http://www.cplusplus.com/reference/cstdio/printf/}{\texttt{int \blue{printf}(const char* format, ...);}}}
5856

5957
\vspace{0.50cm}
6058
\centerline{format: \texttt{\%[flags][width][.precision][length]specifier}}
@@ -80,21 +78,21 @@ \section{IO}
8078
%%%%%%%%%%%%%%%
8179

8280
%%%%%%%%%%%%%%%
83-
\begin{frame}{其它输出函数\texttt{fprintf}, \texttt{sprintf}}
81+
\begin{frame}{其它格式化输出函数\texttt{fprintf}, \texttt{sprintf}}
8482
\begin{center}
8583
\href{http://www.cplusplus.com/reference/cstdio/fprintf/}
86-
{\texttt{int fprintf(FILE *stream, const char *format, ...);}} \\[0.50cm]
84+
{\texttt{int \blue{fprintf}(FILE *stream, const char *format, ...);}} \\[0.50cm]
8785

8886
\href{http://www.cplusplus.com/reference/cstdio/sprintf/}
89-
{\texttt{int sprintf(char *str, const char *format, ...);}}
87+
{\texttt{int \blue{sprintf}(char *str, const char *format, ...);}}
9088
\end{center}
9189
\end{frame}
9290
%%%%%%%%%%%%%%%
9391

9492
%%%%%%%%%%%%%%%
9593
\begin{frame}{格式化输入:\texttt{scanf}}
9694
\centerline{\href{http://www.cplusplus.com/reference/cstdio/scanf/}
97-
{\texttt{int scanf(const char *format, ...)}}}
95+
{\texttt{int \blue{scanf}(const char *format, ...)}}}
9896

9997
\vspace{0.30cm}
10098
\begin{enumerate}
@@ -134,27 +132,27 @@ \section{IO}
134132
%%%%%%%%%%%%%%%
135133

136134
%%%%%%%%%%%%%%%
137-
\begin{frame}{其它输入函数: \texttt{fscanf}, \texttt{sscanf}}
135+
\begin{frame}{其它格式化输入函数: \texttt{fscanf}, \texttt{sscanf}}
138136
\begin{center}
139137
\href{http://www.cplusplus.com/reference/cstdio/fscanf/}
140-
{\texttt{int fscanf(FILE *stream, const char *format, ...);}} \\[0.50cm]
138+
{\texttt{int \blue{fscanf}(FILE *stream, const char *format, ...);}} \\[0.50cm]
141139

142140
\href{http://www.cplusplus.com/reference/cstdio/sscanf/}
143-
{\texttt{int sscanf(const char *s, const char *format, ...);}}
141+
{\texttt{int \blue{sscanf}(const char *s, const char *format, ...);}}
144142
\end{center}
145143
\end{frame}
146144
%%%%%%%%%%%%%%%
147145

148146
%%%%%%%%%%%%%%%
149-
\begin{frame}{Line Input and Output}
147+
\begin{frame}{行输入输出}
150148
\begin{center}
151149
\href{http://www.cplusplus.com/reference/cstdio/fgets/}
152-
{\texttt{char *fgets(char *str, int num, FILE *stream);}} \\[0.30cm]
150+
{\texttt{char *\blue{fgets}(char *str, int num, FILE *stream);}} \\[0.30cm]
153151

154-
\href{http://www.cplusplus.com/reference/cstdio/gets/}{\texttt{char *gets(char *str);}} \\[0.50cm]
152+
\href{http://www.cplusplus.com/reference/cstdio/gets/}{\texttt{\textcolor{gray}{char *gets(char *str);}}} \\[0.50cm]
155153

156154
\href{http://www.cplusplus.com/reference/cstdio/puts/}
157-
{\texttt{int puts(const char *str);}}
155+
{\texttt{int \blue{puts}(const char *str);}}
158156
\end{center}
159157
\end{frame}
160158
%%%%%%%%%%%%%%%

tutorial/c-io/sections/overview.tex

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
\section{课程简介}
22

33
%%%%%%%%%%%%%%%
4-
\begin{frame}{警告:不要在周五的晚上写代码!}
5-
\fignocaption{width = 0.35\textwidth}{figs/code-joke.jpg}
4+
\begin{frame}{忠告:不要在周五的晚上写代码!}
5+
\fignocaption{width = 0.32\textwidth}{figs/code-joke.jpg}
66
\end{frame}
77
%%%%%%%%%%%%%%%
88

9+
%%%%%%%%%%%%%%%
10+
% \begin{frame}{我怎么才能像那些大牛一样,云淡风轻地敲代码?}
11+
% \only<1>{\fignocaption{width = 0.60\textwidth}{figs/donot-know-either.png}}
12+
% \only<2>{
13+
% \begin{columns}
14+
% \column{0.50\textwidth}
15+
% \fignocaption{width = 0.80\textwidth}{figs/practice.jpg}
16+
% \column{0.50\textwidth}
17+
% \fignocaption{width = 0.80\textwidth}{figs/practice-text.png}
18+
% \end{columns}
19+
% }
20+
% \end{frame}
21+
%%%%%%%%%%%%%%%
22+
923
%%%%%%%%%%%%%%%
1024
% \begin{frame}{}
1125
% \begin{columns}
@@ -18,7 +32,7 @@ \section{课程简介}
1832
%%%%%%%%%%%%%%%
1933

2034
%%%%%%%%%%%%%%%
21-
\begin{frame}{辅导课程介绍:C or C++}
35+
\begin{frame}{C 还是 C++?}
2236
\begin{columns}
2337
\column{0.45\textwidth}
2438
C 语言是基础:
@@ -36,6 +50,7 @@ \section{课程简介}
3650
\item Templates
3751
\item STL (Standard Template Library)
3852
\item FP (Functional Programming)
53+
\item Concurrency
3954
\end{itemize}
4055
\end{columns}
4156

@@ -45,29 +60,28 @@ \section{课程简介}
4560
%%%%%%%%%%%%%%%
4661

4762
%%%%%%%%%%%%%%%
48-
\begin{frame}{辅导课程介绍:课程形式}
63+
\begin{frame}{课程形式}
4964
\begin{description}
5065
\setlength{\itemsep}{8pt}
51-
\item[讲解] 语言知识点、常见的``'' (点到为止)
66+
\item[讲解] 语言知识点、常见的``'' \red{(点到为止)}
5267
\item[练习] 指定 OJ题目: 互助练习、从旁辅导
53-
\item[分享] 得意之处、Debug 之痛
54-
\pause
68+
% \item[分享] 得意之处、Debug 之痛 \red{这可是周五晚上!}
5569
\item[课后] 继续完成 OJ 剩余题目
5670
\end{description}
5771
\end{frame}
5872
%%%%%%%%%%%%%%%
5973

6074
%%%%%%%%%%%%%%%
61-
\begin{frame}{C 语言的历史、标准与实现}
62-
\centerline{1972年, Dennis Ritchie 创造了 C 语言:}
63-
\fignocaption{width = 0.20\textwidth}{figs/Ritchie.jpg}
64-
65-
\vspace{0.50cm}
66-
\centerline{K\&R C (1978) $\to$ ANSI C/ISO C (C89/C90) $\to$ C99 $\to$ C11}
67-
68-
\vspace{0.30cm}
69-
\centerline{GCC, Clang, Microsoft Visual C++, $\ldots$}
70-
\end{frame}
75+
% \begin{frame}{C 语言的历史、标准与实现}
76+
% \centerline{1972年, Dennis Ritchie 创造了 C 语言:}
77+
% \fignocaption{width = 0.20\textwidth}{figs/Ritchie.jpg}
78+
%
79+
% \vspace{0.50cm}
80+
% \centerline{K\&R C (1978) $\to$ ANSI C/ISO C (C89/C90) $\to$ C99 $\to$ C11}
81+
%
82+
% \vspace{0.30cm}
83+
% \centerline{GCC, Clang, Microsoft Visual C++, $\ldots$}
84+
% \end{frame}
7185
%%%%%%%%%%%%%%%
7286

7387
%%%%%%%%%%%%%%%
@@ -90,6 +104,7 @@ \section{课程简介}
90104

91105
%%%%%%%%%%%%%%%
92106
\begin{frame}{听说你还没有注册过 $\cdots$}
93-
\fignocaption{width = 0.60\textwidth}{figs/stackoverflow-logo.png}
107+
\fignocaption{width = 0.50\textwidth}{figs/github-logo.png}
108+
\fignocaption{width = 0.55\textwidth}{figs/stackoverflow-logo.png}
94109
\end{frame}
95110
%%%%%%%%%%%%%%%

0 commit comments

Comments
 (0)