Certainly! I can provide you with code examples in JavaScript and C++ to achieve the same task.

**JavaScript:**

```javascript
const filename = 'test.png';
const max_resolution = '512x512';

// Extract the filename without the file extension
const filenameWithoutExtension = filename.split('.')[0];

// Create the new filename by combining filenameWithoutExtension, max_resolution, and '.jpg'
const newFilename = `${filenameWithoutExtension}+${max_resolution}.jpg`;

// Log the new filename to the console
console.log(newFilename);
```

In this JavaScript code, we follow a similar approach as in Python to create the new filename.

**C++:**

```cpp
#include <iostream>
#include <string>

int main() {
    std::string filename = "test.png";
    std::string max_resolution = "512x512";

    // Find the position of the last dot to extract the file extension
    size_t dotPosition = filename.find_last_of('.');

    // Extract the filename without the file extension
    std::string filenameWithoutExtension = filename.substr(0, dotPosition);

    // Create the new filename by combining filenameWithoutExtension, max_resolution, and ".jpg"
    std::string newFilename = filenameWithoutExtension + "+" + max_resolution + ".jpg";

    // Output the new filename
    std::cout << newFilename << std::endl;

    return 0;
}
```

In the C++ code, we use the `find_last_of` function to locate the last dot (.) in the filename, and then we use `substr` to extract the filename without the extension. After that, we create the new filename by concatenating the parts.

These code examples in JavaScript and C++ should help you achieve the same result of creating the new filename 'test+512x512.jpg'.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence