输入字符串遇到换行或空格结束输出

输入字符串遇到换行或空格结束输出


char a[100],c;
int i;
i = 0;
while(scanf("%c",&c) && c != ' ')
{
    
    
a[i] = c;
i++;
}

保存方便后续查看

猜你喜欢

转载自blog.csdn.net/Genius_bin/article/details/112141406