书名号在键盘上怎么打
键盘的输入与屏幕的输出.mp3 00:00 02:23 后退15秒 倍速 快进15秒 今天我想要分享给大家的是C语言程序设计第三章——键盘输入和屏幕输出的内容。今天的主要内容有三部分,分别是单个字符的输入和输出,数据的格式化屏幕输出,数据的格式化键盘输入的内容。Today, I want to share with you the third chapter of C language programming – keyboard input and screen output. Today’s main content has three parts, which are the input and output of single character, the output of data format screen, and the input of data format keyboard.No.1 单个字符的输入与输出1.每次按下tab键,并不是从当前光标位置向后移动一个tab宽度,而是移到下一个制表位,实际移动的宽度视当前光标位置相邻的下一个制表位的距离而定。并且,当转义序列出现在字符串中时,是按单个字符计数的。例如,字符串”abcn“的长度是4而非5,因为字符’’n’代表1个字符。2.在ASCII码取值范围内,对char型数据和int型型数据进行相互转换不会丢失信息,二者可以进行混合运算。同时,一个char型数据既能以字符型格式输出,也能以整型格式输出,以整型格式输出时就是直接输出其ASCII码的十进制值。1. Each time you press the tab key, you do not move one tab width backward from the current cursor position, but move to the next tab. The actual moving width depends on the distance of the next tab adjacent to the current cursor position. Also, when escape sequences appear in a string, they are counted by a single character. For example, the length of the string “ABC / N” is 4 instead of 5, because the character ” n ‘represents 1 character.2. In the range of ASCII value, char data and int data can be converted to each other without losing information, and they can be mixed. At the same time, a char data can be output in both character format and integer format. When it is output in integer format, the decimal value of its ASCII code is directly output.No.2数据的格式化屏幕输出3.函数getchar()没有参数,函数的返回值就是从终端键盘读入的字符。4.输出值参数表是需要输出的数据项的列表,输出数据项可以使变量或表达式,输出值参数之间用逗号分隔,其类型应与格式转换说明符相匹配。每个格式转换说明符和输入值参数表中的输出值参数一一对应,没有输出值参数时,格式控制字符串中不再需要格式转换说明符。3. The function getchar() has no parameters, and the return value of the function is the character read from the terminal keyboard.4. The output value parameter table is the list of data items to be output. The output data items can make variables or expressions. The output value parameters are separated by commas, and their types should match the format conversion descriptors. Each format conversion specifier corresponds to the output value parameter in the input value parameter table one by one. When there is no output value parameter, the format conversion specifier is no longer needed in the format control string.No.3数据的格式化键盘输入5.如果函数scanf()的格式控制字符串中存在除格式说明符以外的其他字符,那么这些字符必须在输入数据时由用户从键盘原样输入。6.在用%c格式读入字符时,空格字符和转义字符都会被当做有效字符读入。参考资料:文字:百度;图片:微博;翻译:百度翻译本文由LearningYard新学苑原创,部分图片文字来自网络,如有侵权请联系。文字|灯? ?等排版|灯? ?等审核|程丽燕 交易担保 面邮优店 五分钟送达的泡面 小程序