<`Д´>C/C++の宿題は私にやらせるニダ!Ver11
■ このスレッドは過去ログ倉庫に格納されています
0074デフォルトの名無しさん
NGNG#include <iostream>
#include <fstream>
#define len 7
const char key[] = "KEYWORD";
int main(int,char **av)
{
using namespace std;
ifstream in(av[1]);
string ls;
string::size_type i;
while(getline(in,ls)){
if((i=ls.find_first_of(',')) != string::npos){
if(!ls.compare(i+1,len,key,0,len)){
cout<<ls<<endl;
}
}
}
}
■ このスレッドは過去ログ倉庫に格納されています