一个C++程序出错
#include <iostream> #include <string> using namespace std; int main() { std::cout << "please enter your first name: "; std::string name ; std::cin >> name ; const std ::string greeting = "hello, " + name + "!"; const std ::string spaces(greeting。 size(),' '); const std ::s...全部
#include <iostream> #include <string> using namespace std; int main() { std::cout << "please enter your first name: "; std::string name ; std::cin >> name ; const std ::string greeting = "hello, " + name + "!"; const std ::string spaces(greeting。
size(),' '); const std ::string second= "* " + spaces + " *"; const std ::string first(second。
size(), '*'); std::cout << std::endl; std::cout << first << std::endl; std::cout << second << std::endl; std::cout << "* "<< greeting << " *" << std::endl; std::cout << second << std::endl; std::cout << first << std::endl; return 0; }楼下不知怎编的 最后return 0没有分号明显错误我vc devc均无错。收起