c语言中关于sscanf函数的运用及%n的用法
http://acm.hdu.edu.cn/showproblem.php?pid=2564上面是题目,下面是解答代码。哪位能指点一下sscanf函数的运用及%n的用法#include"stdio.h" #include"ctype.h" #include"string.h" #define NM 200 char str[NM]; int main() { int n,k,t,l,num; char a[100],*p; scanf("%d尀n",&n); while(n--){ memset(str,0,sizeof(str)); gets(str);p=str; while(sscanf(p,"%s%n",a,&t)==1){//还是返回值和%n的使用牢记 printf("%c",toupper(a[0])); p+=t; } printf("尀n"); } return 0; }