#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
int n;
int i=0;
string tabnapis[1000];
int tab[1000];
for(int i=0; i<1000;i++)
{
tab[i]=0;
}
string napis;
fstream plik;
plik.open("NAPIS.txt", ios::in);
fstream plik2;
plik2.open("wynik.txt", ios:: out|ios::app);
while(getline(plik,napis))
{
tabnapis[i]=napis;
i++;
}
int p;
for(int i=0;i<1000;i++)
{
if(tab[i]!=0) continue;
p=1;
for(int j=i+1; j<1000;j++)
{
if(tabnapis[i]==tabnapis[j])
{
tab[j]=p++;
}
}
}
for(int i=0; i<1000; i++)
{
if(tab[i]==1) plik2 << tabnapis[i] << endl;
}
plik.close();
plik2.close();
return 0;
}
Nie dawno robiłem to w ten sposób :)