W
w0lfey13
Guest
When i try to run this code:
#include <iostream>
#include <cstring>
using namespace std;
int prefix_comun(char x[], char y[])
{
int i = 0;
while (x == y and i < strlen(x) and i < strlen)
i++;
if (i > 0)
return 1;
return 0;
}
int main()
{
int nr = 0;
char t[201], c[21],s[201],*p;
cin.getline(t, 201);
cin.getline(c, 21);
p = strtok(t, " ");
while (p)
{
if (prefix_comun(p, c) == 0)///trebuie sa elimin cuvantul p
{
strcat(s, p);///adauga la sfarsitul lui s, cuvantul p
strcat(s, " ");
nr++;
}
p = strtok(NULL, " ");
}
cout << s << endl;
cout << nr;
}
I get the error: Unable to start program "C:\Users\User\source\repos\pb1\Debug\pb1.exe"
The system cannot find the file specified
Continue reading...
#include <iostream>
#include <cstring>
using namespace std;
int prefix_comun(char x[], char y[])
{
int i = 0;
while (x == y and i < strlen(x) and i < strlen)
i++;
if (i > 0)
return 1;
return 0;
}
int main()
{
int nr = 0;
char t[201], c[21],s[201],*p;
cin.getline(t, 201);
cin.getline(c, 21);
p = strtok(t, " ");
while (p)
{
if (prefix_comun(p, c) == 0)///trebuie sa elimin cuvantul p
{
strcat(s, p);///adauga la sfarsitul lui s, cuvantul p
strcat(s, " ");
nr++;
}
p = strtok(NULL, " ");
}
cout << s << endl;
cout << nr;
}
I get the error: Unable to start program "C:\Users\User\source\repos\pb1\Debug\pb1.exe"
The system cannot find the file specified
Continue reading...