📄 scanf9.c
字号:
#include <stdio.h>#include <stdlib.h>#include <string.h>intmain (void){ int matches; char str[10]; str[0] = '\0'; matches = -9; matches = sscanf ("x ]", "%[^] ]", str); printf ("Matches = %d, string str = \"%s\".\n", matches, str); printf ("str should be \"x\".\n"); if (strcmp (str, "x")) abort (); str[0] = '\0'; matches = -9; matches = sscanf (" ] x", "%[] ]", str); printf ("Matches = %d, string str = \"%s\".\n", matches, str); printf ("str should be \" ] \".\n"); if (strcmp (str, " ] ")) abort (); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -