<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8861235271918107723</id><updated>2024-12-23T23:59:03.840+01:00</updated><category term="Il ciclo in Pascal 1"/><category term="Array in Pascal"/><category term="Basi del linguaggio Pascal"/><category term="Char e String"/><category term="Il ciclo in Pascal 2"/><category term="Introduzione variabili Real"/><category term="Operazioni semplici in Pascal"/><category term="Ramificazione. If"/><category term="else."/><category term="then"/><title type='text'>Fuck you Pascal</title><subtitle type='html'>Impara il Pascal con 7 semplici lezioni!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-1279253977957751776</id><published>2012-06-22T10:19:00.003+02:00</published><updated>2012-11-22T08:36:09.179+01:00</updated><title type='text'>Home</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Arial, sans-serif; font-size: 16.5pt;&quot;&gt;&lt;br /&gt;Pascal&#39;s HOME&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 5.0pt; mso-line-height-alt: 12.75pt;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Arial, sans-serif; font-size: 13.5pt;&quot;&gt;&quot; &amp;nbsp;Writeln (&lt;span style=&quot;color: red;&quot;&gt;&#39;Benvenuto/a&#39;&lt;/span&gt;);&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 5.0pt; mso-line-height-alt: 12.75pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 18pt;&quot;&gt;&amp;nbsp; &amp;nbsp;Readln; &amp;nbsp;&quot;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: .0001pt; margin-bottom: 0cm; mso-line-height-alt: 12.75pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 13.5pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -Cit. Pascal Array (1968-69)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;Un fottuto saluto a tutti voi&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;Nel 2011 ho creato questo blog perché
come ben sappiamo il nostro carissimo professore-automa a stati finiti ha unicamente la
funzione basilare di cliccare un tasto per far scorrere le slide... &lt;br /&gt;Poi secondo
me non le legge nemmeno con la sua voce... (Usa Eloquence e mima il parlato con
la bocca).&lt;br /&gt;
Quindi, il blog è stato fondamentalmente creato per portare alla luce questi
misteri creati unicamente dalla sua cripticità intrinseca e alla sua &quot;voglia di vivere&quot;.&lt;br /&gt;Se seguite bene questa semplice guida (insieme ad esercizio costante)
vi assicuro una riuscita del 100% della prova. Le lezioni sono 7 in tutto e
sono state create per portare chiarezza su questo linguaggio, che nella vita
non vi servirà ad una beata cippa, ma che anzi, vi farà crollare l&#39;autostima
del 79% (Statistiche del professore) e vi farà avere pensieri suicidi.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;Vi invito a mettere &lt;a href=&quot;http://www.facebook.com/fottitipascal/likes&quot; target=&quot;_blank&quot;&gt;mi piace&lt;/a&gt; su Facebook se questa guida è o è stata utile.&lt;br /&gt;
&lt;br /&gt;
Che cosa stai aspettando? Vai all&#39;&lt;a href=&quot;http://fottitipascal.blogspot.it/p/indice-lezioni.html&quot; target=&quot;&quot;&gt;indice&lt;/a&gt; ed esplora la guida!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 12.75pt; margin-bottom: .0001pt; margin-bottom: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;Ti auguro buona fortuna.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, sans-serif; font-size: 10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, sans-serif; font-size: x-small;&quot;&gt;SE QUESTO BLOG TI PIACE, FAMMELO SAPERE!!!&lt;br /&gt;Cliccando qui sotto.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.facebook.com/fottitipascal/likes&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKlvVD1zm7Aejj8gsHYWqjp9dhi9s5ZwCzKCjkzTfOn9NbdUpBVofXFLjn2rRxM6_EefnQS9TXWZ2EvkFOgydVz7iW362knA8aRt6vS9MyQ9PU0ft3ZIyYUIBMWfF45dotL_vPHKoPpIkO/s200/like.png&quot; title=&quot;&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/1279253977957751776/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2012/06/home-sweet-home-writeln-uccidere-pascal.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/1279253977957751776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/1279253977957751776'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2012/06/home-sweet-home-writeln-uccidere-pascal.html' title='Home'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKlvVD1zm7Aejj8gsHYWqjp9dhi9s5ZwCzKCjkzTfOn9NbdUpBVofXFLjn2rRxM6_EefnQS9TXWZ2EvkFOgydVz7iW362knA8aRt6vS9MyQ9PU0ft3ZIyYUIBMWfF45dotL_vPHKoPpIkO/s72-c/like.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-8072754487494975771</id><published>2011-12-04T19:33:00.000+01:00</published><updated>2012-06-29T00:30:54.369+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Array in Pascal"/><title type='text'>Settima Lezione</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
Introduciamo un altro elemento utile per evitare la perdita di tempo nello scrivere molte variabili.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Grazie alla collaborazione (totale) di &lt;a href=&quot;http://www.facebook.com/PsicoPAT.MeL&quot;&gt;Patrizia Mel Marinelli&lt;/a&gt; in questa sesta lezione capiremo come si comporta questa variabile.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
L&#39;array non è altro che uno spazio di memoria dove possiamo inserire e &quot;conservare&quot; più elementi senza dover dichiarare un numero di variabili elevato.&lt;br /&gt;
Questo è un grande vantaggio, infatti, con lo stesso nome si indica una lista di elementi (più o meno lunga a seconda del numero delle caselle specificate), ognuno dei quali è accessibile singolarmente. Cosa significa?&lt;br /&gt;
&lt;br /&gt;
Dopo aver inserito tutti gli elementi nel mio nuovo array, posso accedere al primo elemento, così come all&#39;ultimo, o al terzo in maniera del tutto autonoma e semplificata, come se registrassi tutti i dati in una tabella figurata del genere:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhLtwHht5wB1lhcLZVYXivzg0fBPNwaK7wpzS8ocTHuLslqqlQeVbWHJf5rqemu3CMfSZXHCthSQGVIo3NWqAPsoTf1gk7yGIMtcFLvn9f6tQVfpUkYwSNMx-BMJNnBYWfwwUm7DDUqX6/s1600/array.jpg&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhLtwHht5wB1lhcLZVYXivzg0fBPNwaK7wpzS8ocTHuLslqqlQeVbWHJf5rqemu3CMfSZXHCthSQGVIo3NWqAPsoTf1gk7yGIMtcFLvn9f6tQVfpUkYwSNMx-BMJNnBYWfwwUm7DDUqX6/s1600/array.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Insomma, posso operare su qualsiasi elemento io voglia la dichiarazione di una variabile array(detta in gergo vettore).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
La stesura dell&#39;array è applicata in questo modo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Var A :array[1..n] of &quot;tipo di dato&quot;;&lt;br /&gt;
(dove n è il numero massimo dei dati che si vogliono inserire ed il tipo di dato può comprendere ogni genere di variabile fino ad ora studiato).&lt;br /&gt;
Ad esempio, la schematizzazione in alto potrebbe essere scritta così:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Var A : array[1..8] of integer;&lt;br /&gt;
&lt;br /&gt;
A sarà il nome della mia array e [1..n] sarà il numero di elementi che potrà contenere il mio vettore. Il tipo di dato sarà quello che il mio vettore sarà in grado di contenere.&lt;br /&gt;
Abbiamo appena visto un vettore di tipo integer, ma nulla ci vieta di fare un&#39; array di tipo char o string, o anche real, insomma questa specie di &quot;contenitore&quot; ci semplifica la vita un bel po&#39;!&lt;br /&gt;
L&#39;importante è sapere come si identifica un qualsiasi elemento dell&#39;array.&lt;br /&gt;
Bene, supponiamo di avere il nostro vettore A, per identificare un elemento del vettore è necessario scrivere in questo modo A[1], A[2], A[3] ecc...&lt;br /&gt;
La cosa fantastica è che il numero tra parentesi quadre detto anche &quot;indice&quot; dell&#39;elemento, può essere qualsiasi cosa!&lt;br /&gt;
Mi spiego meglio: Posso scrivere A[i] (nel caso di un ciclo &quot;for,to&quot;), A[length(x)] nel caso di una stringa A[b+1], A[b-1], A[2*2].&lt;br /&gt;
&lt;br /&gt;
Gli array si usano di solito quando dobbiamo lavorare su un numero abbastanza elevato di elementi, in sostanza quando devo inserire dei dati e poi fare delle operazioni sui singoli dati.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In parole povere quando devo tenere memoria di tutto quello che ho inserito perché semplicemente &quot;mi serve dopo&quot;, nulla mi vieta di utilizzare 100 variabili diverse, o 10 variabili diverse, ma avere una variabile sola che identifica con un indice 100 elementi differenti è una bella comodità.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Patrizia Mel Marinelli&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Dopo questa spiegazione impeccabile di Patrizia, dovreste essere entrati un po’ di più nella meccanica delle Array e di Pascal, quindi credo che siate pronti per qualche esercizio con spiegazione:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; margin-bottom: 0cm;&quot;&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Successivo.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt; text-align: right;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/sesta-lezione.html&quot;&gt;Precedente&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/8072754487494975771/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/settima-lezione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/8072754487494975771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/8072754487494975771'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/settima-lezione.html' title='Settima Lezione'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhLtwHht5wB1lhcLZVYXivzg0fBPNwaK7wpzS8ocTHuLslqqlQeVbWHJf5rqemu3CMfSZXHCthSQGVIo3NWqAPsoTf1gk7yGIMtcFLvn9f6tQVfpUkYwSNMx-BMJNnBYWfwwUm7DDUqX6/s72-c/array.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-6727059049196499086</id><published>2011-12-04T18:17:00.000+01:00</published><updated>2012-06-29T00:31:43.967+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="else."/><category scheme="http://www.blogger.com/atom/ns#" term="Ramificazione. If"/><category scheme="http://www.blogger.com/atom/ns#" term="then"/><title type='text'>Sesta Lezione</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;If, then, else.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;In questa lezione introduciamo un nuovo comando e poche altre cose:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;Il nuovo comando è chiamato If,then,else.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIVMRjMBgyYp5Vh8whqwdldHqAsFJlJBD5dIV5UJy-ijaLQkgVFj_gmyM3GhpfA0eEox9iiUkpv5PmuVzvKIKtd11kgJ17PhXLihtxIdns-dDNE18J9rj0R_PdAJsbBaVAIfE_yQSyKnX_/s1600/ifthen.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIVMRjMBgyYp5Vh8whqwdldHqAsFJlJBD5dIV5UJy-ijaLQkgVFj_gmyM3GhpfA0eEox9iiUkpv5PmuVzvKIKtd11kgJ17PhXLihtxIdns-dDNE18J9rj0R_PdAJsbBaVAIfE_yQSyKnX_/s320/ifthen.jpg&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;La &quot;If, then, else&quot; permette di creare una ramificazione al nostro programma, come in esempio, dopo l&#39;istruzione se per un certo motivo l&#39;operazione corrisponde alla then, allora inizia un istruzione, se invece non è così subentra l&#39;else che svolge un&#39;altro tipo di operazione. La else non è necessaria, infatti se ad esempio vogliamo un programma che inizi solo per un certo parametro &quot;If,then&quot;, senza la seconda condizione possiamo anche scartarla.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;Naturalmente le due End, mi daranno soluzioni diverse.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;Adesso facciamo un esempio semplice di come implementare questa operazione molto semplicemente con un programma che una volta inserito un numero, ci dice se è positivo o se è negativo.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; pos_neg;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Var&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;x : integer;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Begin&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Write (&lt;span style=&quot;color: red;&quot;&gt;&#39;Digita un numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Readln (x);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;b&gt;If &lt;/b&gt;x&amp;lt;&amp;gt;0&lt;b&gt; then&lt;/b&gt;;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;If&lt;/b&gt; x&amp;gt;0 &lt;b&gt;then&lt;/b&gt; Write (&lt;span style=&quot;color: red;&quot;&gt;&#39;&#39;,x,&#39; corrisponde ad un numero positivo&#39;&lt;/span&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;else&lt;/b&gt; Write (&lt;span style=&quot;color: red;&quot;&gt;&#39;&#39;,x,&#39; corrisponde ad un numero negativo&#39;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Readln;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Readln;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: small; line-height: 18px;&quot;&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;End.&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif; font-size: small; line-height: 18px;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif; line-height: 18px;&quot;&gt;
Andiamo ad analizzare il contenuto:&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif; line-height: 18px;&quot;&gt;
Abbiamo inserito un&#39;unica variabile che conterrà un valore.&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif; line-height: 18px;&quot;&gt;
La prima if è essenziale, poiché specifica che se il valore è diverso da 0, il programma può continuare con la If,then,else che specifica il numero positivo o il numero negativo.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;trebuchet ms&#39;, verdana, arial, sans-serif; line-height: 18px;&quot;&gt;
La if, then, else dice proprio letteralmente al programma:&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Se x è maggiore di 0, allora scrivi (numero positivo), in caso contrario (else, che in questo caso significa matematicamente x&amp;lt;0) scrivi (numero negativo).&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Il programma si esegue in questo modo:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnNVIcYV6-rll0IyPdsggihCMA0MMaDshZaFtI5d84WhOI4DqrN5v-20Q9MVX2MPravbr_RSdZ8yY9t3ekZmiW1ddNy3cTnOVE2u4MTOznhdIhpWSXHrfq6v9itBPozFojjadFx1rFFWlm/s1600/posif.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; display: inline !important; margin-bottom: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnNVIcYV6-rll0IyPdsggihCMA0MMaDshZaFtI5d84WhOI4DqrN5v-20Q9MVX2MPravbr_RSdZ8yY9t3ekZmiW1ddNy3cTnOVE2u4MTOznhdIhpWSXHrfq6v9itBPozFojjadFx1rFFWlm/s1600/posif.jpg&quot; /&gt;&lt;/a&gt;Se digitiamo un valore positivo, o&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioH5ta6aU5ajzMGqa12gyyQqupIT4yD8aGWFIeoeggms1s5rbkzakffU1Csjl_nKbfXfw5bJhygVNZzVMiflbcZLm2TXvtojsHqQAP45YN2HFIhZGhrcjo6MZ_aSm6oAbF16qCG1iXkQ_B/s1600/negif.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioH5ta6aU5ajzMGqa12gyyQqupIT4yD8aGWFIeoeggms1s5rbkzakffU1Csjl_nKbfXfw5bJhygVNZzVMiflbcZLm2TXvtojsHqQAP45YN2HFIhZGhrcjo6MZ_aSm6oAbF16qCG1iXkQ_B/s1600/negif.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Se digitiamo un valore negativo.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 18px;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Niente di più semplice.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #333333; text-align: right;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/settima-lezione.html&quot;&gt;Successivo&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #333333; text-align: right;&quot;&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/quinta-lezione.html&quot;&gt;Precedente&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/6727059049196499086/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/sesta-lezione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/6727059049196499086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/6727059049196499086'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/sesta-lezione.html' title='Sesta Lezione'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIVMRjMBgyYp5Vh8whqwdldHqAsFJlJBD5dIV5UJy-ijaLQkgVFj_gmyM3GhpfA0eEox9iiUkpv5PmuVzvKIKtd11kgJ17PhXLihtxIdns-dDNE18J9rj0R_PdAJsbBaVAIfE_yQSyKnX_/s72-c/ifthen.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-2224500687693478099</id><published>2011-12-04T14:55:00.000+01:00</published><updated>2012-06-27T08:02:36.387+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Char e String"/><category scheme="http://www.blogger.com/atom/ns#" term="Introduzione variabili Real"/><title type='text'>Quinta Lezione</title><content type='html'>In questa quinta lezione analizzeremo alcune caratteristiche delle variabili che introdurrò oggi, ovvero:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;real&lt;/li&gt;
&lt;li&gt;char&lt;/li&gt;
&lt;li&gt;string&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Real.&lt;/b&gt;&lt;br /&gt;
Partiamo dal primo, il valore real. Questo valore è molto più vasto del valore integer, in quanto è un contenitore che può assumere tutti i valori numerici reali. Un esempio di utilizzo di questo genere di variabile è questo, un programma che fa la media di due numeri (sapendo che la media di due numeri è la divisione per due della loro somma).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; med_num;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Var&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a,b : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;med : real;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi il primo numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (a);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi il secondo numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (b);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;med := (a+b)/&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;2&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La media dei numeri corrisponde a &#39;&lt;/span&gt;,med,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;End.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Abbiamo impostato la media come valore reale, otterremo quindi questo risultato:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA9h36morKmYs2QQkj-ByMybmKVQJ3uBcr15_bbe_Xf9ww6eeN6FSkOsocmf_5ehGnxLw6P02tZ0AM8SCDVkUv8ruDIFx6zNhS8VogBXOwzdgbOajqVsMKxo-Gpo-C10-1k9lQibLks0CC/s1600/mednum.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA9h36morKmYs2QQkj-ByMybmKVQJ3uBcr15_bbe_Xf9ww6eeN6FSkOsocmf_5ehGnxLw6P02tZ0AM8SCDVkUv8ruDIFx6zNhS8VogBXOwzdgbOajqVsMKxo-Gpo-C10-1k9lQibLks0CC/s1600/mednum.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Il numero della media, anche se per noi non comprensibile istantaneamente, è un numero matematicamente corretto. Per avere un risultato numerico più vicino alla matematica di un semplice calcolatore, bisogna scrivere nell&#39;ultima Writeln in questo modo:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&#39;La media dei numeri corrisponde a &#39;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;,med:0:2,&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Scrivendo :0:2 dopo la variabile &quot;med&quot;, si specifica che voglio avere in output un risultato che abbia solo un numero prima della virgola (&quot;0&quot;) e due numeri dopo la virgola (&quot;2&quot;):&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9Qld_VP13lR4qc0HsWUhZku-lR909qryj3BDrS6EtaVdCVXU1IABjE0XTV3NM9hpscJmymh8sJ9hYqE73FbXC2LmOu7naLsrRLRxM69IvbSblzutWhRsWiXTumuC7hevklAKODMlUHegC/s1600/mednum2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9Qld_VP13lR4qc0HsWUhZku-lR909qryj3BDrS6EtaVdCVXU1IABjE0XTV3NM9hpscJmymh8sJ9hYqE73FbXC2LmOu7naLsrRLRxM69IvbSblzutWhRsWiXTumuC7hevklAKODMlUHegC/s1600/mednum2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Se avessi voluto avere 4 numeri dopo la virgola, avrei scritto così &quot;med:0:4&quot;.&lt;br /&gt;
E questa era la condizione di variabile con real, passiamo alla condizione char.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Char.&lt;/b&gt;&lt;br /&gt;
Come già spiegato in precedenza assume il valore di una lettera, ecco ad esempio un programma che memorizza e manda in output una lettera:&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; lettera;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Var&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;x : char;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi una lettera: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (x);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La lettera inserita corrisponde ad &quot;&#39;&lt;/span&gt;,x,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&quot;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;End.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Perfetto, in basso riporto un esempio di funzionamento del programma:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUWlLLMEOQYreAYY7QKVaBvXWT_oE1LYCMVn85lzW_aX9LYndJPym0DtNSg4Np7llYvL9wzVZTeZkrdtaRCLY2ESQ1vWvIhNnFU4FyVcJCOBzzKXx4BQ5Ycu1X1Mb-RnCoz41PXwbhjgSt/s1600/char1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUWlLLMEOQYreAYY7QKVaBvXWT_oE1LYCMVn85lzW_aX9LYndJPym0DtNSg4Np7llYvL9wzVZTeZkrdtaRCLY2ESQ1vWvIhNnFU4FyVcJCOBzzKXx4BQ5Ycu1X1Mb-RnCoz41PXwbhjgSt/s1600/char1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Come si vede, il programma memorizza la lettera &quot;A&quot; nella variabile &quot;x&quot; e così in output, otterrò come risultato la lettera che ho scritto. Ma cosa succede se invece di &quot;A&quot;, scrivessi una parola, come &quot;America&quot;?:&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrHwLzzDaUXKkHXHx5OYT5kh68ycdjO9pKveDiLmK0GFoiI0WgT6ZauRQWNqJhylU7AQZJEQhCQAAYO7waZBc3Xe2-XFXfIltSXY7burpAud3dR5F_g1AgxN9QyJSp2sVhhQBPtwYQaroH/s1600/char2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrHwLzzDaUXKkHXHx5OYT5kh68ycdjO9pKveDiLmK0GFoiI0WgT6ZauRQWNqJhylU7AQZJEQhCQAAYO7waZBc3Xe2-XFXfIltSXY7burpAud3dR5F_g1AgxN9QyJSp2sVhhQBPtwYQaroH/s1600/char2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Il programma mi restituisce solo la prima lettera digitata, &quot;A&quot; in quanto char è un contenitore di una sola lettera. Come fare?&lt;br /&gt;
Per ovviare a questo problema mi serve un&#39;altra variabile.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;String.&lt;/b&gt;&lt;br /&gt;
String è un contenitore di &quot;parole&quot;, fa proprio al caso nostro per l&#39;esercizio di prima. Basta sostanzialmente correggere la variabile da char in string e il gioco è fatto:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt;&amp;nbsp;parola;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Var&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;x : string;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi una parola: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (x);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La parola inserita corrisponde ad &quot;&#39;&lt;/span&gt;,x,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&quot;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;End.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Constatiamo il funzionamento del software con questi esempi:&lt;br /&gt;
Esempio 1.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Lmp_3PwTD5O-hq-KfZFJsWQ9pN6KJ79sLMzSWnBuKjYejwIUgVYGBeSnxtW94h9Yy35zSLw6Ks2TaWNvdKoi9AiUTfLOo_XWgGRO5c5GbzGbZZeFKTxYTPRwSnU_ipcbyh7Ld1iBmh1Z/s1600/america1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Lmp_3PwTD5O-hq-KfZFJsWQ9pN6KJ79sLMzSWnBuKjYejwIUgVYGBeSnxtW94h9Yy35zSLw6Ks2TaWNvdKoi9AiUTfLOo_XWgGRO5c5GbzGbZZeFKTxYTPRwSnU_ipcbyh7Ld1iBmh1Z/s1600/america1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Esempio 2.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqWXAuPED2wm_1N3631hFK3g7lMR48G1BPdxMhpVdoxVI5OCkOk8-i_X9rLmumG1Km9AwuovcZF-ZSvK0otx0TS_F90edp8LaKvELZXR9w7QrinoOA8iSFwcd1zXfWIWP1hYydCWOWhsD/s1600/america2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIqWXAuPED2wm_1N3631hFK3g7lMR48G1BPdxMhpVdoxVI5OCkOk8-i_X9rLmumG1Km9AwuovcZF-ZSvK0otx0TS_F90edp8LaKvELZXR9w7QrinoOA8iSFwcd1zXfWIWP1hYydCWOWhsD/s1600/america2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Bene, ora conosciamo altre 3 variabili, nel prossimo capitolo seguiranno diverse applicazioni di queste ultime. Vi invito a fare delle domande per eventuali incomprensioni e spero di essere stato chiaro fino ad ora.&lt;br /&gt;
&lt;br /&gt;
Fine della Quinta lezione.&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/sesta-lezione.html&quot;&gt;Successivo&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/quarta-lezione.html&quot;&gt;Precedente&lt;/a&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/2224500687693478099/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/quinta-lezione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/2224500687693478099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/2224500687693478099'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/quinta-lezione.html' title='Quinta Lezione'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA9h36morKmYs2QQkj-ByMybmKVQJ3uBcr15_bbe_Xf9ww6eeN6FSkOsocmf_5ehGnxLw6P02tZ0AM8SCDVkUv8ruDIFx6zNhS8VogBXOwzdgbOajqVsMKxo-Gpo-C10-1k9lQibLks0CC/s72-c/mednum.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-8722182784731560554</id><published>2011-12-04T01:16:00.000+01:00</published><updated>2012-05-12T01:28:05.525+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Il ciclo in Pascal 1"/><category scheme="http://www.blogger.com/atom/ns#" term="Il ciclo in Pascal 2"/><title type='text'>Quarta Lezione</title><content type='html'>Il secondo modo di realizzare un ciclo è la While, do.&lt;br /&gt;
Questo metodo è leggermente più elaborato del primo, ed è decisamente poco usato, ma vi potrà essere molto utile. Iniziamo subito con la stesura del programma:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; Somma_tre;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Var&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a,tot : integer;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k:=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a:=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot:=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;While&lt;/b&gt; k &amp;lt;=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;3&lt;/span&gt; &lt;b&gt;do&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Digita un numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (a);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot:=(tot+a);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k:= (k+1);&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;End;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La somma dei numeri corrisponde a: &#39;&lt;/span&gt;,tot,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;End.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Analizziamo subito il programma. Per molti aspetti non si discosta molto dal primo. Le uniche sostanziali variazioni sono la sostituzione del for,to,do al While, do&lt;b&gt;&amp;nbsp;&lt;/b&gt;e abbiamo anche specificato che all&#39;inizio la variabile &quot;k&quot; assume il valore di 1. Oltre a questo, nell&#39;algoritmo che sarà ripetuto ciclicamente (quello tra il secondo Begin e il primo End;) ogni volta che abbiamo una ripetizione, &quot;k&quot; incrementa il suo valore di 1 (ed è proprio per questo che quando k diventa uguale a 4 il ciclo si interrompe, perché non rispetta più il valore k&amp;lt;=3).&lt;br /&gt;
Il valore nella While, do sta a dire proprio &quot;Finché k è minore o uguale a 3 allora ripeti l&#39;operazione&quot;.&lt;br /&gt;
Al terzo inserimento, &quot;k&quot; raggiungerà il valore 4, chiudendo così il ciclo.&lt;br /&gt;
Ecco come funziona:&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8pRUyHXe8EFHASPupp2HDjYYSi3jSujTh-HXotCCrKmO17XzyyvUIykHtN_lSkx3g4qGw1_XiI4QBXbsFKKyD8a292dAOD2KEyZlwOex80H6JSxVc8zbj7c3xiPC4QSFALIT1u2rWcyot/s1600/ciclowhile.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8pRUyHXe8EFHASPupp2HDjYYSi3jSujTh-HXotCCrKmO17XzyyvUIykHtN_lSkx3g4qGw1_XiI4QBXbsFKKyD8a292dAOD2KEyZlwOex80H6JSxVc8zbj7c3xiPC4QSFALIT1u2rWcyot/s1600/ciclowhile.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Il procedimento è uguale a quello della terza lezione, solo che questa volta imponiamo che finché k è minore o uguale a 3 il ciclo si ripeterà. Ebbene, a ogni fine istruzione &quot;k&quot; diventa &quot;k&quot;+1, cioè incrementa il suo valore di 1. Basteranno 3 ripetizioni per raggiungere il valore 4 e uscire dal ciclo.&lt;br /&gt;
&lt;br /&gt;
Detto questo, ora sei in grado di risolvere un&#39;esercizio con un ciclo a tua scelta tra il For,to,do e il While,do:&lt;br /&gt;
&lt;b&gt;Esercizio n° 2.&lt;/b&gt;&lt;br /&gt;
&amp;gt;Crea un programma che moltiplichi 9 numeri. (Prova a farlo con tutti e due i metodi).&lt;br /&gt;
&lt;br /&gt;
L&#39;operazione While,do non si limita soltanto a eseguire delle ripetizioni numerate, ma permette anche di creare un programma in grado di scrivere quanti numeri si vuole per poi eseguire con questi una determinata operazione. Vediamo l&#39;esempio:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; Somma_n;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Var&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a,tot : integer;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a:=1;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot:=0;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;While a&amp;lt;&amp;gt;0 do&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Digita numero [0 per terminare]: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (a);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot:=(tot+a);&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;End;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Il totale corrisponde a: &#39;&lt;/span&gt;,tot,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;End.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
La While recita proprio &amp;lt;Finché &quot;a&quot; è diversa da 0, allora ripeti il ciclo&amp;gt;&lt;br /&gt;
Quando si inserisce 0 nella variabile &quot;a&quot; il ciclo termina e il programma da il risultato dei numeri inseriti:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho5BtoJN40RLBWUrO_Hd_2-zugyjgUJbahRHzrMIatZn1FITZ4kikFqMwK70lyxelRNJRA_223tXCqHkO9LDvxBn5hS9ZO1P8akh8yJ_W8bjAF8A-k6_V3dBVN_rQPApCcplu6ZcSQh8dZ/s1600/ciclok.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho5BtoJN40RLBWUrO_Hd_2-zugyjgUJbahRHzrMIatZn1FITZ4kikFqMwK70lyxelRNJRA_223tXCqHkO9LDvxBn5hS9ZO1P8akh8yJ_W8bjAF8A-k6_V3dBVN_rQPApCcplu6ZcSQh8dZ/s1600/ciclok.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Sono stati inseriti dei numeri nel programma, e se il valore non è zero, il ciclo continua all&#39;infinito. Quando si vuole terminare il calcolo, non si fa altro che digitare 0 come valore.&lt;br /&gt;
&lt;br /&gt;
Un&#39; altra variante di questo esercizio, ovvero di creare un programma in grado di fare operazioni similari con un certo numero di numeri (scusate il gioco di parole) è questo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; Somma_numeri;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Var&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;x,tot : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;n : integer;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Benvenuto nel programma di somma, premi INVIO per continuare&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Quanti numeri vuoi sommare?: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (n);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k :=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;x :=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;while k &amp;lt;=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;n &lt;/span&gt;do&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Begin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Digitare il valore &#39;&lt;/span&gt;,k,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (x);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot := tot+x;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k := k+1;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;End;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La somma corrisponde a &#39;&lt;/span&gt;,tot,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Premi INVIO per continuare&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;End.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;Non sarà il programma che rivoluzionerà il mondo, ma ha la sua dose di buona interfaccia per una corretta comprensione dell&#39;utente che lo usa.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;E&#39; la stessa cosa del ciclo di While, solo che in questo caso è l&#39;utente a decidere quanti numeri vuole sommare, grazie alla variante &quot;n&quot; che sostituisce il numero predefinito di ripetizioni.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;Una volta superato il numero &quot;n&quot; il ciclo terminerà lasciando il risultato.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;Per una migliore comprensione sono stati aggiunti anche dettagli sullo starter del programma, che si da con un semplice comando di INVIO e una fine correlata con il risultato che indica all&#39;utente che per terminare la sessione deve premere INVIO.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;Ecco come funziona il programma, ad esempio voglio sommare 5 numeri:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix5jt2Ii-rCSIsWOJKlKDX2Rv5byjBj7ZuA_8HoSHydc83t5GzK2qHjGx2EVIp_7Efe9vj2XfWudIt5PaP4d4RQJ-cSoUli4ShIlRDcYDt91r6kaDad-P0QBawqZpLNis57xP_z-5RGx6c/s1600/sommanumeri.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEix5jt2Ii-rCSIsWOJKlKDX2Rv5byjBj7ZuA_8HoSHydc83t5GzK2qHjGx2EVIp_7Efe9vj2XfWudIt5PaP4d4RQJ-cSoUli4ShIlRDcYDt91r6kaDad-P0QBawqZpLNis57xP_z-5RGx6c/s1600/sommanumeri.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Bene, come avete notato, dopo &quot;Digitare il valore&quot; vi è il numero progressivo della variante &quot;k&quot; che incrementa di un numero ogni volta che si ripete l&#39;operazione, ed è per questo che è ottima per farne derivare il numero dell&#39;operazione. La ripetizione perpetua di &quot;Digitare il valore&quot; diventa &quot;Digitare il valore 1&quot;, &quot;Digitare il valore 2&quot; e così via.&lt;br /&gt;
Fine della Quarta Lezione.&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/quinta-lezione.html&quot;&gt;Successivo&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/terza-lezione.html&quot;&gt;Precedente &lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/8722182784731560554/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/quarta-lezione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/8722182784731560554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/8722182784731560554'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/quarta-lezione.html' title='Quarta Lezione'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8pRUyHXe8EFHASPupp2HDjYYSi3jSujTh-HXotCCrKmO17XzyyvUIykHtN_lSkx3g4qGw1_XiI4QBXbsFKKyD8a292dAOD2KEyZlwOex80H6JSxVc8zbj7c3xiPC4QSFALIT1u2rWcyot/s72-c/ciclowhile.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-5873070595432088462</id><published>2011-12-03T21:43:00.000+01:00</published><updated>2012-05-12T01:27:11.348+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Il ciclo in Pascal 1"/><title type='text'>Terza Lezione</title><content type='html'>E&#39; stato difficile fare un programma che sottraesse tre numeri?&lt;br /&gt;
Di sicuro avete speso molto tempo nello scrivere tutto, si, forse difficile, ma non impossibile:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; Sottrazione_tre;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Var&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a,b,c : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi il primo numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Read (a);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi il secondo numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Read (b);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi il terzo numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Read (c);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k:= (a-b-c);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La sottrazione corrisponde a :&#39;&lt;/span&gt;,k,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;End.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Ecco la soluzione, niente di difficile. Ma cosa dovremmo fare se ci si presentasse una traccia del genere?:&lt;br /&gt;
&lt;b&gt;&amp;gt;Si realizzi un programma che sommi 100 numeri.&lt;/b&gt;&lt;br /&gt;
Di certo perderemmo ogni senno, ogni residua ragione se dovessimo scrivere 100 writeln e 100 readln.&lt;br /&gt;
&lt;br /&gt;
Ed è per questo che possiamo implementare un ciclo:&lt;br /&gt;
Che cos&#39;è un ciclo?&lt;br /&gt;
Un ciclo è un&#39;operazione perpetua che continua finché non raggiunge un certo numero prestabilito, finchè diciamo rispetti una condizione che poniamo in precedenza.&lt;br /&gt;
Es: Continua a ripetere la stessa istruzione di somma finché i valori non rispettano la condizione in pieno.&lt;br /&gt;
Schematizzando possiamo ottenere questo:&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNcQhEuKtN67WiBbR2yK6IfVdfLUuGLkHfEoL8jMB7VDU7MgXNZ9OiOx6qOvIkymabaZcX4LitO-W-GaNNX6EHm2lz5KvITDRigEPp9ziBbd7G-ldWC6mLJyWWoba7axVGu0CgMM5STpp/s1600/ciclo.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNcQhEuKtN67WiBbR2yK6IfVdfLUuGLkHfEoL8jMB7VDU7MgXNZ9OiOx6qOvIkymabaZcX4LitO-W-GaNNX6EHm2lz5KvITDRigEPp9ziBbd7G-ldWC6mLJyWWoba7axVGu0CgMM5STpp/s200/ciclo.jpg&quot; width=&quot;172&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Schema Ciclo&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
In questo schema, si intuisce che innanzitutto sono presenti due Begin, uno in cui sono contenute le condizioni, in questo caso, usando un po di immaginazione, le condizioni ci dicono che le istruzioni in basso, dopo il secondo Begin, vanno ripetute 3 volte.&lt;br /&gt;
&lt;br /&gt;
Una volta esaurite le condizioni, ovvero, appena le istruzioni sono state fatte per la terza volta in questo caso, il ciclo si interrompe perché ha rispettato tutte le condizioni e si ha così il risultato finale che, in un programma di somma, può essere la somma di 3 numeri, o in un programma di moltiplicazione, la moltiplicazione di 3 numeri.&lt;br /&gt;
&lt;br /&gt;
Questa è soltanto un&#39;immagine grafica per capire cosa fa il programma durante il ciclo, ora proviamo a scrivere un programma che riesca a fare la somma di 3 numeri, utilizzando un ciclo.&lt;br /&gt;
Ci sono due metodi per implementare un ciclo:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;La condizione For to do.&lt;/li&gt;
&lt;li&gt;La condizione While do.&lt;/li&gt;
&lt;/ol&gt;
Esaminiamo la prima.&lt;br /&gt;
For, to, do, è usato principalmente per implementare un ciclo, ed è molto semplice da usare, ad esempio, vogliamo la nostra condizione nella quale bisogna ripetere questo:&lt;br /&gt;
Write (&#39;Scrivi il numero: &#39;);&lt;br /&gt;
Readln (a);&lt;br /&gt;
Per 3 volte come da traccia. Ebbene, tra il primo e il secondo begin scriveremo questa condizione:&lt;br /&gt;
&lt;b&gt;For k:=1 to 3 do&lt;/b&gt;&lt;br /&gt;
Dove k è una variabile integer che abbiamo inserito all&#39;inizio.&lt;br /&gt;
Esaminiamo il programma completo:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; Somma_tre;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Var&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;k : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a,tot : integer;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a:=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot:=&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;0&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;For k:= &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;1&lt;/span&gt; to &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue;&quot;&gt;3&lt;/span&gt; do&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Digita un numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (a);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot:=(tot+a);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;End;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Writeln (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La somma dei numeri corrisponde a: &#39;&lt;/span&gt;,tot,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;End.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Come di norma, analizziamo tutto il contenuto:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Abbiamo inserito una variabile k (integer) che svolgerà la variabile del ciclo, poi un&#39;altra variabile &quot;a&quot; (che sarà ripetuta 3 volte) in cui digiteremo tutti e tre i numeri della somma ed un&#39;altra, &quot;tot&quot; che sarà il contenitore della somma e anche il primo addendo all&#39;interno del ciclo.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Nel primo Begin, specifico che il valore attuale di &quot;a&quot; e di &quot;tot&quot; corrispondono a 0 per il momento (sono variabili ed è proprio per questo che hanno la proprietà di variare nel tempo). Poi inserisco la condizione For, to, do e specifico per &quot;k&quot; da 1 a 3 fai la stessa operazione.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Parte il secondo Begin che termina con un primo End con il punto e virgola. Tra questi due è racchiusa l&#39;istruzione che sarà ripetuta 3 volte, ovvero di digitare la variabile &quot;a&quot; e l&#39;istruzione che il totale è uguale all&#39;attuare totale (&quot;tot&quot;) + &quot;a&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Dopo il primo End, Scriviamo l&#39;operazione per visualizzare la somma e terminiamo con un secondo End.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Il programma svolge questo:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVFgJkXQrBnYrQaYELgS-BtjGFhX51S0OxZpmCTZaYOVPYlML4bVdKE3B76za6v5XBf19gZLQalwfFlNoWmXu9KmYnM2CoGAMMPfnqkDi6VcBzAoO34AIkcswBDWZ7KcCc8-PexMeAb1A1/s1600/prociclo1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVFgJkXQrBnYrQaYELgS-BtjGFhX51S0OxZpmCTZaYOVPYlML4bVdKE3B76za6v5XBf19gZLQalwfFlNoWmXu9KmYnM2CoGAMMPfnqkDi6VcBzAoO34AIkcswBDWZ7KcCc8-PexMeAb1A1/s1600/prociclo1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Vediamo cosa accede passo per passo nel programma:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8VqCN3rhXPbh4wyWfIuhCKA0ddDDUfy1L7wc0bAAnfXVSNr_0uwg-h3ikFeAjtHniso56PQJygb5K5EuEnWmQPJoxPCjYZqbZIp0fvAHPsCXc86MzMMnfBazHgTrKq6g0qpEo85W0lKE3/s1600/inprogram.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;131&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8VqCN3rhXPbh4wyWfIuhCKA0ddDDUfy1L7wc0bAAnfXVSNr_0uwg-h3ikFeAjtHniso56PQJygb5K5EuEnWmQPJoxPCjYZqbZIp0fvAHPsCXc86MzMMnfBazHgTrKq6g0qpEo85W0lKE3/s320/inprogram.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
La variabile &quot;k&quot; è valida da 1 a 3, dopo il 3, il ciclo si interromperà. Si inserisce il primo numero nella variabile &quot;a&quot;, in questo caso 4, l&#39;istruzione del secondo Begin ci dice che il totale &quot;tot&quot; è uguale a &quot;tot&quot; + &quot;a&quot;, e per questo, visto che all&#39;inizio, nel primo begin era scritto che il tot:=0, ne consegue che il programma eseguirà questa operazione:&lt;br /&gt;
tot = 0(&quot;tot&quot;) + 4(&quot;a&quot;). Adesso il totale è uguale a 4. La variabile &quot;k&quot; non è ancora soddisfatta, quindi l&#39;operazione tra il secondo Begin e il primo End si ripete per la seconda volta. Inserendo un&#39;altra volta la &quot;a&quot; con il valore 7, avremmo che il tot ora è uguale a 4(primo &quot;tot&quot;) + 7(&quot;a&quot;). Ora il tot è uguale a 11, e questo accadrà anche quando il ciclo si ripeterà per la terza ed ultima volta (11+3=14).&lt;br /&gt;
Questo era il ciclo con il For, il to e il do, nella quarta lezione vi mostrerò come fare un ciclo con While e do.&lt;br /&gt;
Fine della Terza lezione.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/quarta-lezione.html&quot;&gt;Successivo&lt;/a&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/seconda-lezione.html&quot;&gt;Precedente&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/5873070595432088462/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/terza-lezione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/5873070595432088462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/5873070595432088462'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/terza-lezione.html' title='Terza Lezione'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwNcQhEuKtN67WiBbR2yK6IfVdfLUuGLkHfEoL8jMB7VDU7MgXNZ9OiOx6qOvIkymabaZcX4LitO-W-GaNNX6EHm2lz5KvITDRigEPp9ziBbd7G-ldWC6mLJyWWoba7axVGu0CgMM5STpp/s72-c/ciclo.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-7298603343305029486</id><published>2011-12-03T17:36:00.000+01:00</published><updated>2012-05-12T01:25:51.684+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Operazioni semplici in Pascal"/><title type='text'>Seconda Lezione</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Eccoci giunti alla seconda lezione, dove capiremo come si possono sfruttare le operazioni.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Niente di più semplice.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Le operazioni sono delle formule tra variabili (spiegate nella prima lezione).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;La stessa operazione (come la somma, la moltiplicazione, la divisione) è indicata come variabile ed è specificata all&#39;interno del programma.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Ora vediamo un semplice programma di somma tra 2 numeri:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Program&lt;/b&gt; Somma_numeri;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Var&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;a,b : integer;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot : integer;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi il primo numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (a);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Scrivi il secondo numero: &#39;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln (b);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;tot:= (a+b);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;La somma corrisponde a &#39;&lt;/span&gt;,tot,&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;Readln;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;End.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Ebbene, analizziamo l&#39;esempio riga per riga:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Nella prima, come sempre si specifica che quello che sto scrivendo è un programma, poi si digita il nome.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Nella seconda inserisco il comando Var, per poi in seguito inserire le variabili.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Inserisco solo le variabili che mi servono, come &quot;a&quot; che conterrà il mio primo numero di imput e &quot;b&quot; che conterà il secondo e assegno il valore di numero intero (con integer);&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Inserisco una terza variabile che farà da contenitore del risultato, ovvero &quot;tot&quot;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Impartisco al programma il comando begin per iniziare il programma sempre dopo le variabili.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Write non è essenziale, poiché avrei potuto solo scrivere il primo numero, serve solo a far capire a chi utilizza il programma cosa deve fare per andare avanti.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Read (a); serve per digitare il numero, e così anche Read (b);&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Siamo alla decima stringa, quella essenziale. Grazie al comando inserito nella stringa il programma capisce che il totale (la nostra variabile &quot;tot&quot;) è uguale alla somma di &quot;a&quot; e di &quot;b&quot;.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Infine Scriviamo che il numero è corrispondente a &quot;tot&quot; come abbiamo già visto in precedenza, con questo metodo: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Write (&#39;Text &#39;,var,&#39;&#39;);&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Mettiamo un read per non terminare il programma senza aver visualizzato il risultato.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Ed ecco infine il comando End. che termina la sessione.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Il programma funziona così:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizmzN23yqaq9gelJ6nRxhuxHwzQCKlBHp-T_LCnETzZoqItXTOLYfqkfO5F7RvlnlrD0rd9igxm-_0VQvsXgW2yV6k8yTpe8aRHS7DFhuBreX0AI9FMC-3P0igI5SvXcVV8pM14XjcSOTi/s1600/somma.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizmzN23yqaq9gelJ6nRxhuxHwzQCKlBHp-T_LCnETzZoqItXTOLYfqkfO5F7RvlnlrD0rd9igxm-_0VQvsXgW2yV6k8yTpe8aRHS7DFhuBreX0AI9FMC-3P0igI5SvXcVV8pM14XjcSOTi/s1600/somma.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Sapendo questo, ora potresti riuscire a creare un programma che riesca a fare operazioni diverse dalla somme, come ad esempio un programma di sottrazione, sostituendo&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;tot:= (a+b) con tot:=(a-b).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Ora le operazioni che puoi fare sono la moltiplicazione, la divisione, la somma e sottrazione.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Esercizio 1.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;gt;Conoscendo questo, prova a creare un programma che faccia la sottrazione di tre numeri.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(Soluzione in Terza lezione).&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Fine della Seconda lezione&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/terza-lezione.html&quot;&gt;Successivo&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/prima-lezione.html&quot;&gt;Precedente&lt;/a&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/7298603343305029486/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/seconda-lezione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/7298603343305029486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/7298603343305029486'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/seconda-lezione.html' title='Seconda Lezione'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizmzN23yqaq9gelJ6nRxhuxHwzQCKlBHp-T_LCnETzZoqItXTOLYfqkfO5F7RvlnlrD0rd9igxm-_0VQvsXgW2yV6k8yTpe8aRHS7DFhuBreX0AI9FMC-3P0igI5SvXcVV8pM14XjcSOTi/s72-c/somma.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8861235271918107723.post-8035035634198088653</id><published>2011-12-02T19:16:00.000+01:00</published><updated>2012-06-27T07:52:39.528+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Basi del linguaggio Pascal"/><title type='text'>Prima Lezione</title><content type='html'>Questa è la prima lezione del programma Pascal, (quella famosa lezione fondamentale che riesce a farti capire qualcosa sul funzionamento e a che cazzo serve). Se pensi che non sia necessaria per la tua preparazione, puoi anche saltarla e andare direttamente alla seconda lezione.&lt;br /&gt;
Ebbene, il Pascal è un linguaggio &lt;strike&gt;inutile e di merda&lt;/strike&gt; avanzato che permette di costruire o programmare un qualsiasi programma, infatti il programma in se sa svolgere delle basilari operazioni di calcolo.&lt;br /&gt;
Con pascal è possibile creare anche giochi ad altissima definizione come il Tetris!&lt;br /&gt;
Si, è proprio questo che ci fa intuire che stiamo studiando un programma del secolo scorso, un punto in più per la teoria che in Italia siamo dei retrogradi!&lt;br /&gt;
&lt;br /&gt;
Come detto in Pascal si possono fare delle operazioni molto basilari.&lt;br /&gt;
Conoscere il linguaggio è essenziale:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Iniziando un programma bisogna scrivere in partenza il comando:&amp;nbsp;&lt;b&gt;Program &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;, in seguito, dopo uno spazio scriveremo il nome che vogliamo assegnare al programma che sarà uno a nostra scelta, possiamo scrivere una lettera, come una parola, ma non possiamo usare spazi nel nome ed è per questo che si usano i trattini bassi. Alla fine si deve mettere il punto e virgola.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;Nel programma possono essere presenti le variabili, che sono contenitori numerici, di lettere, di parole che hanno appunto la proprietà di cambiare durante il programma. Per usare una variabile dopo il comando Program, accapo si scrive &lt;b&gt;Var &lt;/b&gt;. Le possibili variabili sono molteplici, ma elenco solo quelle essenziali per il momento:&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;integer &amp;nbsp; (un numero intero)&lt;/li&gt;
&lt;li&gt;real &amp;nbsp; &amp;nbsp; &amp;nbsp; (un numero reale)&lt;/li&gt;
&lt;li&gt;char &amp;nbsp; &amp;nbsp; &amp;nbsp;(un carattere come ad esempio &quot;p&quot;)&lt;/li&gt;
&lt;li&gt;string &amp;nbsp; &amp;nbsp;(una stringa di caratteri)&lt;/li&gt;
&lt;/ul&gt;
Il programma inizia il suo funzionamento con l&#39;istruzione &lt;b&gt;Begin &lt;/b&gt;che permette appunto di mandare in esecuzione il programma.&lt;br /&gt;
Altri due comandi sono&lt;br /&gt;
Write (&#39;Testo&#39;);&lt;br /&gt;
nel quale è possibile inserite un testo che sarà mandato in output sullo schermo e&lt;br /&gt;
Read;&lt;br /&gt;
Con il quale sarà possibile leggere il testo scritto o inserire un numero in un contenitore indicato nel comando &lt;b&gt;Var&lt;/b&gt;&amp;nbsp;.&lt;br /&gt;
&lt;br /&gt;
Dopo saranno specificate tutte le funzioni e gli algoritmi che devono essere effettuati fino all&#39;istruzione &lt;b&gt;End. &lt;/b&gt;&amp;nbsp;che termina in modo definitivo il programma.&lt;br /&gt;
Adesso vi mostro il primo esempio di un programma elementare con variabili:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Program&lt;/b&gt; Scrivi_numero; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---------&amp;gt; il punto e virgola va specificato&lt;br /&gt;
&lt;b&gt;Var &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;b&gt;----------&amp;gt; il punto e virgola non va specificato&lt;/b&gt;&lt;br /&gt;
a : integer; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---------&amp;gt; il punto e virgola va specificato&lt;br /&gt;
&lt;b&gt;Begin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ----------&amp;gt; il punto e virgola non va specificato&lt;/b&gt;&lt;br /&gt;
Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Inserisci un numero&#39;&lt;/span&gt;);&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---------&amp;gt; il punto e virgola va specificato&lt;br /&gt;
Read (a);&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;---------&amp;gt; il punto e virgola va specificato&lt;br /&gt;
&lt;b&gt;End.&lt;/b&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;----------&amp;gt; il punto è necessario&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
In questo programma si specifica che la variabile è la lettera a, grazie al comando &lt;b&gt;Var &lt;/b&gt;ed in seguito con Begin si inizia il programma dove la Write chiede di inserire un numero (potevamo anche scrivere &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;inserisci un cazzo di numero&lt;/span&gt;) e si noti che la scritta tra parentesi è chiusa tra apici per il testo. Poi si ha la Read che mi dice che il numero che inserirò va inserito direttamente nella variabile che ho scritto in precedenza venendo così salvato.&lt;br /&gt;
&lt;br /&gt;
Il programma finisce salvando per una frazione di secondo il numero che ho inserito, poiché quando la sessione è terminata con la End. il programma chiudendosi perde tutti i dati assimilati.&lt;br /&gt;
Ma se volessi visualizzare il numero che ho scritto, come dovrei fare?:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Program&lt;/b&gt;&amp;nbsp;Scrivi_numero; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;b&gt;Var&lt;/b&gt;&lt;br /&gt;
a : integer; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;b&gt;Begin &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;br /&gt;
Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Inserisci un numero: &#39;&lt;/span&gt;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
Read (a);&lt;br /&gt;
Writeln; &amp;nbsp; &lt;br /&gt;
Readln; &lt;br /&gt;
Write (&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;Il numero inserito corrisponde a: &amp;nbsp;&#39;&lt;/span&gt;,a, &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&#39;&#39;&lt;/span&gt;)&lt;br /&gt;
Readln;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;b&gt;End.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
Il programma si eseguirà così:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2p6sxj2GwuNJe5tuyqlRe5wjVHURTOfJpSeqMaFuAygibfUbMEO4wj6Hgp__MhKVQZv5-1HMIBeNrBNs-x_8LL9GSI6Z7S3KyGWl1iC_CLpHgqYn97ZeWZfmTl458l_g7e3fM_XYx0DXs/s1600/Program+nome1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2p6sxj2GwuNJe5tuyqlRe5wjVHURTOfJpSeqMaFuAygibfUbMEO4wj6Hgp__MhKVQZv5-1HMIBeNrBNs-x_8LL9GSI6Z7S3KyGWl1iC_CLpHgqYn97ZeWZfmTl458l_g7e3fM_XYx0DXs/s1600/Program+nome1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
La sostanziale differenza tra Write, Read e Writeln e Readln è che questi ultimi dicono al programma di andare daccapo infatti, nel programma se invece della prima Write scrivessi Writeln, il valore sarebbe digitato daccapo:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS6hs2QFZO2OHx3_MN4L-nnaHdzxone0NOozEekKQ6l7AFrJjnKlK1CMX4dWt9SJoCkBH1LDK9qT0hWNh7TAMADlaHlFRkd6-CWHYL2teLpTvmYxDybKKnSebf4aULw2bhHSpvfZ30y7XT/s1600/Program+nome2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS6hs2QFZO2OHx3_MN4L-nnaHdzxone0NOozEekKQ6l7AFrJjnKlK1CMX4dWt9SJoCkBH1LDK9qT0hWNh7TAMADlaHlFRkd6-CWHYL2teLpTvmYxDybKKnSebf4aULw2bhHSpvfZ30y7XT/s1600/Program+nome2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
il Writeln e il Readln vuoti mi danno uno spazio tra il primo e il secondo testo.&lt;br /&gt;
L&#39;ultimo Readln; serve a leggere la Write superiore, nell&#39;ultima Write abbiamo visualizzato il numero che abbiamo inserito tramite le virgole che circondano la &quot;a&quot; che servono a far capire al programma che si tratta proprio di quel contenitore in cui abbiamo appena inserito il numero.&lt;br /&gt;
Molte operazioni possono essere effettuate tra le varianti per ottenere diverse formule, le principali sono:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;+, -, *, / &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Sono i valori di somma, sottrazione, moltiplicazione e divisione.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Indica che una variabile è maggiore di un&#39; altra.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;lt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Indica che una variabile è minore di un&#39; altra.&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;=&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Indica che una variabile è uguale ad un&#39; altra.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;gt;= &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Indica che una variabile è maggiore o uguale ad un&#39;altra.&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;lt;=&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Indica che una variabile è minore o uguale ad un&#39;altra.&amp;nbsp;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;&amp;lt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Indica che una variabile è diversa da un&#39;altra.&lt;/li&gt;
&lt;/ul&gt;
Queste sono le principali operazioni, e possono essere effettuate sia tra variabili che tra numeri digitati.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Fine della prima lezione.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: right;&quot;&gt;
&lt;a href=&quot;http://fottitipascal.blogspot.it/2011/12/seconda-lezione.html&quot;&gt;Successivo&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fottitipascal.blogspot.com/feeds/8035035634198088653/comments/default' title='Commenti sul post'/><link rel='replies' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/prima-lezione.html#comment-form' title='0 Commenti'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/8035035634198088653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8861235271918107723/posts/default/8035035634198088653'/><link rel='alternate' type='text/html' href='http://fottitipascal.blogspot.com/2011/12/prima-lezione.html' title='Prima Lezione'/><author><name>FuckYouPascal</name><uri>http://www.blogger.com/profile/07735942785904180343</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2p6sxj2GwuNJe5tuyqlRe5wjVHURTOfJpSeqMaFuAygibfUbMEO4wj6Hgp__MhKVQZv5-1HMIBeNrBNs-x_8LL9GSI6Z7S3KyGWl1iC_CLpHgqYn97ZeWZfmTl458l_g7e3fM_XYx0DXs/s72-c/Program+nome1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>