这需要是一个 C++ 程序:
Write a complete C program to enter a first name, middle name and last name in separate variables. The user is to enter the names in all capital letters. You are to write a function to convert the names to uppercase first letter, rest of the letters lower case. Combine the names into one string and output the string (make sure you have a space between each name). Count the number of characters (including spaces) in the total name and output that.
我对字符串不太熟悉,可以使用一些指导来了解从哪里开始。
最佳答案
在 C++ 中你需要 std::string和 std::tolower , std::toupper 。
在 C 中,这将依赖 string manipulation in the CRT (C 运行时库)。
由于这是家庭作业,如果您再次陷入困境,这应该可以帮助您继续前进。
关于c++ - 不知道如何将 "JOHN"更改为 "John",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4139370/