Hi ha creus X68547


Statement
 

pdf   zip

html

Programa una funció hay_cruces(M) que, donada una matriu de dimensions fil*col (per fil,col ≥ 3) amb elements "-" i "*", retorni True quan hi hagi almenys una creu. Una creu és un patró:

-*-

***

-*-

Sample session
>>> M=[["-", "*", "-", "-"],
...    ["*", "*", "*", "*"],
...    ["-", "*", "-", "-"]]
>>> hay_cruces(M)
True
>>> M=[["-", "-", "-"],
...    ["*", "*", "*"],
...    ["-", "*", "-"],
...    ["-", "-", "-"]]
>>> hay_cruces(M)
False
Information
Author
InfBesos
Language
Catalan
Translator
Original language
Spanish
Other languages
English Spanish
Official solutions
Python
User solutions
Python