---+++ Esercizio 1 ---++Test 1 *Input* <verbatim> 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? - </verbatim> *Output* <verbatim> bla 24 se 8 quale 6 sotto 5 lei 4 io 4 adesso 4 sei 4 dove 4 cielo 4 </verbatim> ---+++ Esercizio 2 ---++Test 1 *Input* <verbatim> 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? </verbatim> *Output* <verbatim> 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 </verbatim> ---++ Test 2 *Input* <verbatim> 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. </verbatim> *Output* <verbatim> 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 </verbatim> ---++ Test 3 *Input* <verbatim> 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? </verbatim> *Output* <verbatim> np = 14 Se lei io adesso sei dove sotto quale cielo pensi al tuo domani bla </verbatim> ---++Test 4 *Input* <verbatim> </verbatim> *Output* <verbatim> np = 0 </verbatim> ---+++ 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* <verbatim> 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 </verbatim> *Output* <verbatim> 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 </verbatim> ---++ Test 2 *Input* <verbatim> 0 0 0 0 </verbatim> *Output* <verbatim> parole a distanza -1: 0 parole a distanza 0: 4 parole a distanza 1: 0 parole a distanza 2: 0 </verbatim> ---++ Test 3 *Input* <verbatim> 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 </verbatim> *Output* <verbatim> 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 </verbatim> ---++ Test 4 *Input* <verbatim> 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 </verbatim> *Output* <verbatim> 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 </verbatim> -- Users.JulindaStefa - 10 Dec 2007
This topic: Programmazione1
>
WebHome
>
Prog1PZ
>
HomeworksPZ0708
>
Testing3PZ0708
Topic revision: r1 - 2007-12-10 - JulindaStefa
Copyright © 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