2015-10-06 48 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

相關問題