Funny thing is that I can't get much to work right in cs50.h so I've just been looking up standard c programming techniques. It's just been much easier to find working examples on the Internet using standard c without cs50.h. for the life of me I can't get get_string() in cs50.h working even though I copied the example in the manual.
This link has 3 great samples for string input and output
The scanf() in example 1 doesn't support spaces. Example 2 uses getchar() and I like this version for learning because it forces you to go through the process of capturing every letter. I've been helping my young son learn this.
Example 3 uses gets() but that is an extremely dangerous function. It produces code that is extremely likely to be exploited. Make will even warn you about it even though it will compile.
The function that was recommended by an elite programmer was fgets(). Here's a great example of how to use it. https://www.w3resource.com/c-programming-exercises/string/c-string-exercise-4.php