同时输入多个字符串C语言
怎么用一个scanf输入多个字符串再打印多个字符串 #include <stdio.h>int main(void)
{
char c , s ;
int i , n ;
for(c = n = 0 ; c != '\n'; n ++) scanf("%s%c" , s , & c) ;
printf("%s" , s) ;
for(i = 1 ; i < n ; i ++) printf(" %s" , s) ;
printf("\n") ;
}
编译运行实况:
D:\\C>g++ -o x x.c
D:\\C>x
I am a businessman !
I am a businessman !
D:\\C>
页:
[1]