Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
求助,刚开始学c语言
#include <stdio.h> int main() { char str[3]; // 创建一个字符数组来存储输入的字符串,包括终止符'\0' printf("请输入字符串: "); scanf("%2s", str); // 限制输入的最大字符数为2(包括终止符) printf("输入的字符串是: %s\n", str); return 0; }