reading multiple image files and getting their grey level using cpp code

I want to read multiple image files and get their grey level. For now, I can only read one image file and get their grey level using codes below.
How to read multiple image files in a program? (name of image file like pict001, pic002,…,pic200.)
Actually, I don’t know why it must be used wstring infilename(L”pic001.jpg”)? Or there is something else workable?

Thanks!

#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
#include <gdiplus.h>
#include <src/stdafx.h>
#pragma comment(lib, "gdiplus.lib")

using namespace std;
using namespace Gdiplus;

int main()
{
int R, G, B;
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

wstring infilename(L"pic001.jpg");
string outfilename("color.txt");

Bitmap* bmp = new Bitmap(infilename.c_str());
UINT height = bmp->GetHeight();
UINT width = bmp->GetWidth();
cout << "width " << width << ", height " << height << endl;

Color color;
ofstream fout(outfilename.c_str());

for (UINT y = 0; y < height; y++)
{
    for (UINT x = 0; x < width; x++)
    {
        bmp->GetPixel(x, y, &color);
        R = (int)color.GetRed();
        G = (int)color.GetGreen();
        B = (int)color.GetBlue();
        //fout << (R * 299 + G * 587 + B * 114 + 500) / 1000 <<","<< endl;
        fout << (R * 299 + G * 587 + B * 114 + 500) / 1000 <<" "<< endl;
    }
}
fout.close();
delete bmp;
GdiplusShutdown(gdiplusToken);
system("pause");
return 0;
}