Mógłby mi ktoś powiedzieć jak przerobić kod tak żeby wczytywał tylko liczby nieparzyste ?
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
/* run this program using the console pauser or add your own getch, system("pause") or input loop /
using namespace std;
int liczba;
int main(int argc, char* argv) {
string linia;
fstream plik;
plik.open("plik.txt");
if(plik.good() == true)
{
while(!plik.eof())
{
getline(plik, linia);
if(linia[linia.length()-1] == '0')
cout << linia<<endl;
}
plik.close();
}
system("pause");
return 0;
}