How to receive SCANF to receive space characters?

xiaoxiao2021-03-06  25

A string is required to give a string and find out the longest word output.

For example, give a string "what are you doing"

The longest word is doing, then the program prints the string "doing".

I first define the character array char s [50]

And use SCANF ("% s", s) to receive strings, but the string received by Scanf is only stopped at the first space.

Do you have other ways to solve this problem?

转载请注明原文地址:https://www.9cbs.com/read-39426.html

New Post(0)