您的位置:首页 > 其它

scanf函数的用法

2014-02-20 19:07 295 查看
#include <stdio.h>
main()
{
char ch,nch;    /* */
int count;    /* */
int k;        /* */

printf("Please input a string with a # in the end.\n");
scanf("%c",&ch);    /* */
while(ch != '#')    /* */
{
if(ch >= '0' && ch <= '9')
{
/* */
count = ch-'0'+1;    /* */
scanf("%c",&nch);    /* */
for(k=0;k<count;k++)    /* */
printf("%c",nch);
}
else
printf("%c",ch);    /* */
printf(" ");            /* */
scanf("%c",&ch);        /* */
}
printf("#\n");                /* */
}
scanf("%c",&nch); 这一句scanf函数怎么运行的 他还是要手动输入字符进去吗?
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: