Page 46 - MATINF Nr. 9-10
P. 46
46 D.A. Popescu, D. Constantin
for(k=0;k<8; k++){
in = i + dl[k];
jn = j + dc[k];
if(in >=1 && in <=m && jn >=1 && jn <=n && a[in][jn] == 1)
fill(in ,jn);
}
}
int main (){
cit ();
//det x0 ,y0
int i,j;
for(i=1;i<=m;i++)
for(j=1;j<=n;j++)
if(a[i][j]==1){
x0 = i;
y0 = j;
}
fill(x0 ,y0);
fout <<Aria;
return 0;
}
6 Probleme propuse pentru rezolvare
Pentru a v˘ familiariza cu algoritmul fill v˘ propunem s˘ rezolvat , i problemele aflate la link-urile urm˘atoare:
a
a
a
https://www.pbinfo.ro/probleme/eticheta/128/fill
https://www.pbinfo.ro/probleme/830/generare2
https://www.pbinfo.ro/probleme/840/croco
https://www.pbinfo.ro/probleme/844/croco1
https://www.infoarena.ro/problema/padure
https://www.infoarena.ro/problema/ferma3
http://campion.edu.ro/arhiva/index.php?page=problem&action=view&id=1574
http://campion.edu.ro/arhiva/index.php?page=problem&action=view&id=534
http://campion.edu.ro/arhiva/index.php?page=problem&action=view&id=135
http://campion.edu.ro/arhiva/index.php?page=problem&action=view&id=1195
Bibliografie
[1] D.A. Popescu, Bazele program˘arii - Limbajul C++, infobits Bucures , ti, 2021. http://ebooks.infobits.ro/acasa/
83-bazele-programarii-limbajul-cpp-volumul-1-doru-anastasiu-popescu-2021.html.
[2] M. S , erban, E. Cerchez, Programarea in limbajul C/C++ pentru liceu, Volumul 2, Editura Polirom, 2021. http:
//polirom.ro/calculatoare-informatica/7933-programarea-C3AEn-limbajul-cc-pentru-liceu-volumul-al-ii-lea.html.
[3] https://www.pbinfo.ro/.
[4] https://www.infoarena.ro/.
[5] http://campion.edu.ro/arhiva/.