Goodevening everybody.
I have a problem like this, I want to write script that take word from first fail and put in other only in that case if there is 'm' letter, but my script only takes first word and I can't find my problem, can anybody help me?/
#include <iostream>
#include <fstream>
using namespace std;
const int size=10;
int main(){
char c;
int i=0, z=0;
char s[size];
fstream fin ("in.txt", ios::in);
fstream fout ("out.txt", ios::out);
fin.get(c);
while (!fin.eof()){
if (c==' ' or c==',' or c=='.' or c=='!' or c=='?' or c==':' or c=='(' or c==')')//nolasītais c ir pieturzīme
{
if (!fout.is_open()) fout.open("out", ios::out);
else {
fin.get(c);
}
} else
{
while (c!=' ' and c!=',' and c!='.' and c!='!' and c!='?' and c!=':' and c!='(' and c!=')' and !fin.eof()) //kamer nav pieturzīme
{
s[i]=c; // ieraksta masīvā
i++;
fin.get(c);
}
for (int k=0; k<i;k++){ if(s[k]=='m')