2015-10-06 62 views

回答

3

是的,这是非常可能的。你可以写你scanf这样的 -

if(scanf("%19s %19[^0-9]%d",name,last_name,&number)==3){ //assuming both array of size 20 
/*    ^this will read and store in array until a numbers is encountered */ 
    // print them 
} 

Click on link to see working code

+0

太感谢你了! – Lenny

+0

@Lenny很高兴帮助:) – ameyCU

相关问题