0% found this document useful (0 votes)
26 views12 pages

ASLKD

The document contains C++ code that defines a 2D array and uses a queue to flood fill values in the array. It also contains functions for outputting the array values and initializing the array with test patterns before calling the flood fill function.

Uploaded by

emiemioltean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views12 pages

ASLKD

The document contains C++ code that defines a 2D array and uses a queue to flood fill values in the array. It also contains functions for outputting the array values and initializing the array with test patterns before calling the flood fill function.

Uploaded by

emiemioltean
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

#include <iostream>

#include <queue>

using namespace std;

//ifstream cin("b.in");

//ofstream cout("b.out");

char v[10001][1001]= {'.'};

int l=0,o=

int out()

for(int i=0; i<=16; i++)

for(int k=1; k<=21; k++)

cout<<v[i][k];

cout<<'\n';

cout<<'\n'<<'\n';

for(int i=1; i<=200000000; i++)

i=i;

int lee ()

queue <pair<int,int>> q;

q.push({6,11});

while(!q.empty())
{ds fwefgyugfuhsdbf df

] f\AF]\ SDF

DF \WEG

l++;

if(l==o)

out();

o+=6;

int x=q.front().first;

int y=q.front().second;

q.pop();

if(v[x+1][y]=='.')

v[x+1][y]='1';

q.push({x+1,y});

if(v[x][y+1]=='.')

v[x][y+1]='1';

q.push({x,y+1});

if(v[x][y-1]=='.')

v[x][y-1]='1';

q.push({x,y-1});

if(v[x-1][y]=='.')

{
v[x-1][y]='1';

q.push({x-1,y});

int rez2()

//c 5 6

for(int i=0; i<=100; i++)

for(int k=0; k<=100; k++)

v[i][k]='.';

for(int i=0; i<=5; i++)

for(int k=1; k<=20; k++)

if(abs(i-5)+abs(k-6)==5)

v[i][k]='1';

else

v[i][k]='.';

}
}

//c 5 17

for(int i=0; i<=5; i++)

for(int k=1; k<=30; k++)

if(abs(i-5)+abs(k-16)==5)

v[i][k]='1';

// c 5 12

for(int i=6; i<=20; i++)

for(int k=1; k<=30; k++)

if(abs(i-5)+abs(k-11)==11)

v[i][k]='1';

out();

lee();
out();

int rez (int x)

if(b[x]==p1[x])

for(int i=0; i<=x; i++)

cout<<b[i];

for(int i=1; i<=200000000; i++)

i=i;

cout<<'\n';

if(x==7)

return 0;

rez(x+1);

else

for(int i=0; i<=x; i++)

cout<<b[i];
}

for(int i=1; i<=50000000; i++)

i=i;

cout<<'\n';

b[x]++;

rez(x);

return 0;

int cnt=0;

int f=0;

int main()

if(1)

cout<<"Introduceti parola:"<<'\n';

int n;

string par;

bool ok=1;

while(ok)

cin>>par;

if(p==par || p1==par)
{

cout<<"Pregatita?"<<'\n';

for(int i=1; i<=200000000; i++)

i=i;

cout<<"3"<<'\n';

for(int i=1; i<=200000000; i++)

i=i;

cout<<"2"<<'\n';

for(int i=1; i<=200000000; i++)

i=i;

cout<<"1"<<'\n';

rez(0);

break;

else

cnt++;
if(cnt==1 || cnt==2)

cout<<"Parola Gresita"<<'\n';

continue;

if(cnt==3)

cout<<"Parola Gresita"<<'\n';

cout<<"Indiciu?"<<'\n'<<"da sau nu"<<'\n';

string a;

cin>>a;

f++;

if((a=="DA" || a=="Da" || a=="da" ) && f==1)

cout<<"Doua cuvinte lipite"<<'\n';

cnt=1;

continue;

else if((a=="DA" || a=="Da" || a=="da" ) && f==2)


{

cout<<'\n'<<"_ _ _ _ _ _ _ _"<<'\n';

cnt=1;

continue;

else if((a=="DA" || a=="Da" || a=="da" ) && f==3)

cout<<'\n'<<"t____c"<<'\n';

cnt=1;

else if((a=="DA" || a=="Da" || a=="da" ) && f==4)

cout<<'\n'<<"te__sc"<<'\n';

cnt=1;

continue;

else if((a=="DA" || a=="Da" || a=="da" ) && f==5)

cout<<'\n'<<"tei_besc"<<'\n';

cnt=1;

continue;

else if((a=="DA" || a=="Da" || a=="da" ) && f==5)


{

cout<<'\n'<<"teiubesc"<<'\n';

cnt=1;

continue;

else if((a=="DA" || a=="Da" || a=="da" ) && f==5)

cnt=1;

//z2

if(1)

cout<<"Pregatita?";

string h;

cin>>h;

for(int i=1; i<=300000000; i++)

i=i;
}

rez2();

//z3

return 0;

You might also like