Skip to content

Commit

Permalink
aim for C++98
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 22, 2024
1 parent 21cb461 commit 4219851
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cplusplus/p0004.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ unsigned int p0004() {
for (i = 100; i < 1000; i++) {
for (j = 100; j < 1000; j++) {
prod = i * j;
std::string forward = std::to_string(prod);
char buf[8] = {};
sprintf(buf, "%u", prod);
std::string forward(buf);
std::string reverse = forward;
std::reverse(reverse.begin(), reverse.end());
if (forward == reverse) {
Expand Down

0 comments on commit 4219851

Please sign in to comment.