Cod sursa(job #2855413)

Utilizator mustea15Mustean Dan mustea15 Data 22 februarie 2022 13:40:48
Problema Abc2 Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.65 kb
#include <iostream>
#include <fstream>
#include <string.h>

using namespace std;

ifstream f("abc2.in");
ofstream g("abc2.out");

bool Aparut(int i, char s[], char sss[50001][21])
{
    for(i; i>=1; i--)
    {
        cout<<s;
        if(sss[i]==s)
            return true;
    }
    return false;
}
int main()
{
    int k=0, l=1;
    char s[10001], ss[20], sss[50001][21];
    f>>s;
    while(f>>ss)
    {
        strcpy(sss[l], ss);
        l++;
    }
    for(int i=1; i<=l; i++)
    {
        if(strstr(s, sss[i]) && Aparut(i, sss[i], sss)==false)
        {
            k++;
        }
    }
    cout<<k;
    return 0;
}