>>710
#include <string>
#include <iostream>
#include <vector>
#include <windows.h>
#include <stack>
using namespace std;
class dirdata{ public: string name; int n;};

main(){
string findstr;
cout<<"ファイル名を入力して下さい "; cin>>findstr;
stack <dirdata> dir; vector<string> path;
int N; dirdata x; WIN32_FIND_DATA fd; HANDLE hd=NULL;
x.name="c:\\"; x.n=1; dir.push(x);
while(1){
if(hd==NULL)goto fst;
if(!FindNextFile(hd, &fd)){
fst: CloseHandle(hd);
if(dir.empty()) return 0;
x=dir.top(); dir.pop();
N=x.n+1;path.resize(N);
path[N-1]=path[N-2]+x.name;
hd = FindFirstFile((path[N-1]+"*").c_str(), &fd);}
if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)){
if(findstr==fd.cFileName)cout<<" PATH = "<< path[N-1]+fd.cFileName<<endl;}
else if(fd.cFileName[0]!='.' || ( fd.cFileName[1]!='.' && fd.cFileName[1]!='\0' ))
{x.name=(string)fd.cFileName+"\\"; x.n=N; dir.push( x );}}}