Cod sursa(job #253721)

Utilizator ghitzZzaGheorghita Hurmuz ghitzZza Data 6 februarie 2009 11:49:01
Problema Episoade Scor 0
Compilator cpp Status done
Runda Stelele Informaticii 2009, clasele 9-10, ziua 1 Marime 1.36 kb
#include<fstream>
#include<string.h>

using namespace std;

int main(){
    char *text1,*text2,*car;
    int i,j,m,n,q,k;
    
    ifstream in("episoade.in");
    ofstream ou("episoade.out");
    in>>text1;
    in>>k;
    in>>q;
    
    
    
    for(j=0;j<k;j++){
                     in>>text2;
                     for(i=0;i<q;i++){
                     car=strchr(text1,text2[i]);
                     if(car){
                             m=car-text1;
                             if(text1[m+1]=='>'){
                                                 if(text1[m+2]==text2[i+1])
                                                 n=1;
                                                 else
                                                 n=0;
                                                 }
                             if(text1[m+1]='#'){
                                                 if(text1[m+1]==text2[i+1])
                                                 n=1;
                                                 else
                                                 n=1;
                                                 }
                                                 }
                             }}
                     ou<<n;
                    
    
    
   
    return 0;
}