c#
习 题 四
1. C# 的空白字符有哪些?
答案:空白被定义为任何含 Unicode 类 Zs 的字符(包括空白字符)以及水平制表符、垂直制表符和换页符
2. 何谓转义字符?有哪些?
答案:
| 转义序列 | 字符名称 | Unicode 编码 |
| \' | 单引号 | 0x0027 |
| \" | 双引号 | 0x0022 |
| \\ | 反斜杠 | 0x005C |
| \0 | Null | 0x0000 |
| \a | 警报 | 0x0007 |
| \b | BackspaceBackspace |
0x0008 |
|
\f |
换页符 |
0x000C |
|
\n |
换行符 |
0x000A |
|
\r |
回车 |
0x000D |
|
\t |
水平制表符 |
0x0009 |
|
\v |
垂直制表符 |
0x000B |
3. 写出10个运算符。
答案:
{ } [ ] ( ) . , : ;
+ - * / % & | ^ ! ~
= < > ? ?? :: ++ -- && ||
-> == != <= >= += -= *= /= %=
&= |= ^= << <<= => 之一
right-shift:
>|>right-shift-assignment:
>|>=right-shift 和 right-shift-assignment 产生式中的竖线用来表示:和采用句法文法的其他产生式不同,在标记之间不允许有任何类型的字符(甚至不允许空白)
4. 写出10个关键字。
答案:
| abstract | as | base | bool | break |
| byte | case | catch | char | checked |
| class | const | continue | decimal | default |
| delegate | do | double | else | enum |
| event | explict | extern | false | finally |
| fixed | float | for | foreach | goto |
| if | implicit | in | int | interface |
| internal | is | lock | long | namespace |
| new | null | object | operator | out |
| override | params | private | protected | public |
| readonly | ref | return | sbyte | sealed |
| short | sizeof | stackalloc | static | string |
| struct | switch | this | throw | true |
| try | typeof | uint | ulong | unchecked |
| unsafe | ushort | using | virtual | void |
| volatile | while |
浙公网安备 33010602011771号