Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<fstream.h>
- int main(){
- ifstream f1("BAC.TXT");
- int n,m,v[100],i=0,x,s,t=0,y,ok;
- f1>>m>>n;
- while(i<m){
- f1>>x;
- i++;
- v[i]=x;}
- while(f1>>x){
- s=0;
- y=0;
- ok=0;
- for(i=1;i<=m && ok==0;i++){
- if(v[i]!=x)
- s++;
- y++;
- if(y!=s)
- ok=1;}
- if (s==m){
- cout<<x<<" ";
- t++;}}
- cout<<endl<<t;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement