14 lines
301 B
C++
14 lines
301 B
C++
#include "iostream"
|
|
#include <cstring>
|
|
#include <cwchar>
|
|
#include <string>
|
|
|
|
int main() {
|
|
std::string msg = "hello world";
|
|
for (int i = 0; i < msg.length(); i++) {
|
|
std::cout << msg[i];
|
|
if (i != msg.length() - 1 && msg[i+1] != ' ' && msg[i] != ' ')
|
|
std::cout << '-';
|
|
}
|
|
return 0;
|
|
}
|