42_CPP00/ex00/megaphone.cpp
Camille Chauvet 67fbbf113b init
2023-05-17 16:41:46 +00:00

23 lines
466 B
C++

#include <iostream>
#include <string>
#include <cctype>
int main(int argc, char *argv[]) {
if (argc < 2) {
std::cout << "* LOUD AND UNBEARABLE FEEDBACK NOISE *" << std::endl;
return 0;
}
std::string message;
for (int i = 1; i < argc; i++) {
message += argv[i];
}
for (int i = 0; message[i] != '\0'; i++) {
message[i] = std::toupper(message[i]);
}
std::cout << message << std::endl;
return 0;
}