Tags:
create new tag
view all tags

Esercizio 1

Test 1

Input

Se lei se io, adesso sei dove sotto quale cielo pensi al tuo domani? ; . , : bla bla bla bla bla bla quale,
se io se lei: adesso dove sei sotto quale cielo pensi al tuo domani!!! bla bla bla quale bla bla bla; sotto?
se io se lei? adesso dove sei sotto quale cielo pensi al tuo domani;;; bla bla bla bla bla bla!
se io se lei, adesso dove sei sotto quale cielo pensi al tuo domani,,, bla bla bla bla bla bla?
-
Output
bla 24
se 8
quale 6
sotto 5
lei 4
io 4
adesso 4
sei 4
dove 4
cielo 4

Esercizio 2

Test 1

Input

To be, or not to be,that is the question:
Whether tis nobler in the mind to suffer
The slings and arrows of outrageous fortune
Or to take arms against a sea of troubles,
And by opposing end them?To die,to sleep,
No more; and by a sleep to say we end
The heartache, and the thousand natural shocks
That flesh is heir to,tis a consummation
Devoutly to be wishd. To die,to sleep;
To sleep! perchance to dream:ay, theres the rub;

To be, or not to be,that is the question:
Whether tis nobler in the mind to suffer
The slings and arrows of outrageous fortune
Or to take arms against a sea of troubles,
And by opposing end them?
Output
np = 50
To
be
or
not
that
is
the
question
Whether
tis
nobler
in
mind
suffer
slings
and
arrows
of
outrageous
fortune
take
arms
against
a
sea
troubles
by
opposing
end
them
die
sleep
No
more
say
we
heartache
thousand
natural
shocks
flesh
heir
consummation
Devoutly
wishd
perchance
dream
ay
theres
rub

Test 2

Input

Jul. Ay me!
Jul. O Romeo, Romeo! wherefore art thou Romeo?
    Deny thy father and refuse thy name!
    Or, if thou wilt not, be but sworn my love,
    And I will no longer be a Capulet.
Rom. She speaks.
  O, speak again, bright angel! for thou art
  As glorious to this night, being over my head,
  As is a winged messenger of heaven
  Unto the white upturned wond ring eyes
  Of mortals that fall back to gaze on him
  When he bestrides the lazy pacing clouds
  And sails upon the bosom of the air. 
Jul. O Romeo, Romeo! wherefore art thou Romeo?
    Deny thy father and refuse thy name!
    Or, if thou wilt not, be but sworn my love,
    And I will no longer be a Capulet.
Output
np = 74
Jul
Ay
me
O
Romeo
wherefore
art
thou
Deny
thy
father
and
refuse
name
Or
if
wilt
not
be
but
sworn
my
love
I
will
no
longer
a
Capulet
Rom
She
speaks
speak
again
bright
angel
for
As
glorious
to
this
night
being
over
head
is
winged
messenger
of
heaven
Unto
the
white
upturned
wond
ring
eyes
mortals
that
fall
back
gaze
on
him
When
he
bestrides
lazy
pacing
clouds
sails
upon
bosom
air

Test 3

Input

Se lei se io, adesso sei dove sotto quale cielo pensi al tuo domani? ; . , : bla bla bla bla bla bla quale,
se io se lei: adesso dove sei sotto quale cielo pensi al tuo domani!!! bla bla bla quale bla bla bla; sotto?
se io se lei? adesso dove sei sotto quale cielo pensi al tuo domani;;; bla bla bla bla bla bla!
se io se lei, adesso dove sei sotto quale cielo pensi al tuo domani,,, bla bla bla bla bla bla?
Output
np = 14
Se
lei
io
adesso
sei
dove
sotto
quale
cielo
pensi
al
tuo
domani
bla

Test 4

Input


Output
np = 0

Esercizio 3

Per questo esercizio i test gli ho fatti nel seguente modo: ho chiamato la vostra funzione terre_distanti con 4 matrici diverse in dimensione e/o contenuto. Per ognuna di queste matrici ho testato le distanze da -1 a n .

Test 1

Input

1 1 1 1 1 1 
0 0 0 0 0 0
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
Output
parole a distanza -1: 0
parole a distanza 0: 6
parole a distanza 1: 12
parole a distanza 2: 6
parole a distanza 3: 6
parole a distanza 4: 6
parole a distanza 5: 0
parole a distanza 6: 0

Test 2

Input

0 0
0 0
Output
parole a distanza -1: 0
parole a distanza 0: 4
parole a distanza 1: 0
parole a distanza 2: 0

Test 3

Input

0 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
Output
parole a distanza -1: 0
parole a distanza 0: 1
parole a distanza 1: 3
parole a distanza 2: 5
parole a distanza 3: 7
parole a distanza 4: 0

Test 4

Input

1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
Output
parole a distanza -1: 0
parole a distanza 0: 0
parole a distanza 1: 0
parole a distanza 2: 0
parole a distanza 3: 0
parole a distanza 4: 0
parole a distanza 5: 0

-- JulindaStefa - 10 Dec 2007

Topic revision: r1 - 2007-12-10 - JulindaStefa






 
Questo sito usa cookies, usandolo ne accettate la presenza. (CookiePolicy)
Torna al Dipartimento di Informatica
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback