正在加载图片...
运行情况: 例字符串输入举例 Ch6 11c 输入:How are you'? 输出:a=How #include <stdio.h b-are mainO) c-you? {char a[15],b[5],c[5] 输入:How are you? scanf("%s%s%s",a,b,c); 输出:a=How printf("a-=%s nb-%s nc-%s\n",a,b,c); scanf("%s",a), printf("a-%s n",a); scanf中%s输入时,遇空格 或回车结束 运行情况: 输入:How are you? H 0 年 0 a r 0 y ?0例 字符串输入举例 H o w \0 a r e \0 y o u ? \0 #include <stdio.h> main() { char a[15],b[5],c[5]; scanf("%s%s%s",a,b,c); printf("a=%s\nb=%s\nc=%s\n",a,b,c); scanf("%s",a); printf("a=%s\n",a); } 运行情况: 输入:How are you? 输出:a=How b=are c=you? 输入:How are you? 输出:a=How scanf中%s输入时,遇空格 或回车结束 运行情况: 输入:How are you?
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有