http://codingteam.net/atom/paste
Notepad
Latest pastes in the notepad.
2010-03-11T19:15:26+01:00
nombre mystère
2010-02-28T22:15:38+01:00
http://codingteam.net/paste/show/578
louiz
http://codingteam.net/users/show/louiz
<pre class="cpp" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include <iostream></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include "stdlib.h"</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> main<span style="color: #008000;">(</span><span style="color: #0000ff;">void</span><span style="color: #008000;">)</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">int</span> i<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">int</span> nb<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">int</span> nbchance<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">int</span> nbjoueur<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Voici les regles du jeu :"</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Vous devez trouver un nombre positif"</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"compris entre 0 et 100. Ce nombre n'est"</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"pas un decimal, ni une fraction, c'est"</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"un entier naturel. Pret a relever le defis ?"</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> srandom<span style="color: #008000;">(</span>getpid<span style="color: #008000;">(</span><span style="color: #008000;">)</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span> <span style="color: #666666;">// initialise le random</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> nb <span style="color: #000080;">=</span> random<span style="color: #008000;">(</span><span style="color: #008000;">)</span> <span style="color: #000040;">%</span> <span style="color: #0000dd;">100</span><span style="color: #008080;">;</span> <span style="color: #666666;">// assigne un nombre aléatoire compris entre 0 et 100</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> nbchance <span style="color: #000080;">=</span> <span style="color: #0000dd;">5</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span><span style="color: #008000;">(</span>i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #008080;">;</span> i <span style="color: #000080;"><</span> nbchance <span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">)</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Saisir un nombre..."</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cin</span> <span style="color: #000080;">>></span> nbjoueur<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">if</span><span style="color: #008000;">(</span>nbjoueur <span style="color: #000080;">==</span> nb<span style="color: #008000;">)</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Very good, you're a winner !"</span><span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">if</span><span style="color: #008000;">(</span>nbjoueur <span style="color: #000080;">></span> nb<span style="color: #008000;">)</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Trop grand !!!"</span><span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">if</span><span style="color: #008000;">(</span>nbjoueur <span style="color: #000080;"><</span> nb<span style="color: #008000;">)</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Trop petit !!!"</span><span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Sorry you're a loser ! La reponse etait : "</span><span style="color: #000080;"><<</span> nb <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
fail
2010-02-14T17:51:21+01:00
http://codingteam.net/paste/show/576
mathieui
http://codingteam.net/users/show/mathieui
<pre class="text" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">copying xmpp/auth.py -> build/lib/xmpp</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">copying xmpp/features.py -> build/lib/xmpp</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">copying xmpp/debug.py -> build/lib/xmpp</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">copying xmpp/commands.py -> build/lib/xmpp</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cd src/xmpppy-0.5.0rc1 && pwd && python setup.py build && cp -r xmpp ..</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">/home/mathieui/pkg/poezio-svn/src/poezio/src/xmpppy-0.5.0rc1</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">running build</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">running build_py</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/entries »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/all-wcprops »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/debug.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/filetransfer.py.svn-base »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/protocol.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/roster.py.svn-base »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/__init__.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/transports.py.svn-base »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/auth.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/dispatcher.py.svn-base »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/browser.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/jep0106.py.svn-base »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/client.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/commands.py.svn-base »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/simplexml.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/session.py.svn-base »: Permission non accordée</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">cp: impossible de créer le fichier standard « ../xmpp/.svn/text-base/features.py.svn-base »: Permission non accordée</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">make: *** [all] Erreur 1</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">==> ERREUR: La compilation a échoué.</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> Abandon...</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
MPD_sima missing debbug message
2010-01-22T10:25:49+01:00
http://codingteam.net/paste/show/575
kaliko
http://codingteam.net/users/show/kaliko
<pre class="text" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:49 - INFO Playing: Tom Waits - Rainbirds</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:49 - DEBUG Currently 0 track(s) ahead. (target 1)</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:49 - INFO The playlist needs tracks.</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:49 - INFO Looking for artist similar to "Tom Waits"</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:49 - DEBUG Requesting last.fm for "Tom Waits"</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - DEBUG Looking for another artist in play history.</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - WARNING Trying with previous artist: Mon Côté Punk</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - INFO Looking for artist similar to "Mon Côté Punk"</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - DEBUG "Mon Côté Punk" already in cache, not requesting last.fm.</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - INFO Some similar artist(s) – first five: Les Ogres de Barback / La Rue Kétanou / Les Blérots de R.A.V.E.L / Les Tit' Nassels / Karpatt...</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - INFO Looking availability in MPD library</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - DEBUG Already cross check MPD library for this artist.</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - DEBUG current searched "Tom Waits"</div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">2010-01-22 02:00:50 - INFO Got 18 artists in library (at least 22% similar).</div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li></ol></pre>
Re: Fibonacci.cpp
2010-01-15T21:15:28+01:00
http://codingteam.net/paste/show/574
jbell
http://codingteam.net/users/show/jbell
<pre class="cpp" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include <iostream></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include <vector></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include <string></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include <sstream></span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include <algorithm></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define TYPE unsigned long</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define BASE 1000000000</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define LENGTH 9</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">class</span> VeryLongInt <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">public</span><span style="color: #008080;">:</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt<span style="color: #008000;">(</span><span style="color: #0000ff;">long</span> init <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">)</span> <span style="color: #008080;">:</span>m_array<span style="color: #008000;">(</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">while</span> <span style="color: #008000;">(</span> init <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array.<span style="color: #007788;">push_back</span><span style="color: #008000;">(</span>init<span style="color: #000040;">%</span>BASE<span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> init<span style="color: #000080;">=</span>init<span style="color: #000040;">/</span>BASE<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt<span style="color: #008000;">(</span><span style="color: #0000ff;">const</span> VeryLongInt <span style="color: #000040;">&</span> toCopy<span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array <span style="color: #000080;">=</span> toCopy.<span style="color: #007788;">m_array</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> ~VeryLongInt<span style="color: #008000;">(</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">const</span> VeryLongInt operator<span style="color: #000040;">+</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">const</span> VeryLongInt <span style="color: #000040;">&</span> other<span style="color: #008000;">)</span> <span style="color: #0000ff;">const</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt result<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> vector<span style="color: #000080;"><</span>TYPE<span style="color: #000080;">></span> other_<span style="color: #000080;">=</span>other.<span style="color: #007788;">m_array</span>, m_array_<span style="color: #000080;">=</span>m_array<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> TYPE carry <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">long</span> size <span style="color: #000080;">=</span> max<span style="color: #008000;">(</span>m_array.<span style="color: #007788;">size</span><span style="color: #008000;">(</span><span style="color: #008000;">)</span>, other.<span style="color: #007788;">m_array</span>.<span style="color: #007788;">size</span><span style="color: #008000;">(</span><span style="color: #008000;">)</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> other_.<span style="color: #007788;">resize</span><span style="color: #008000;">(</span>size, <span style="color: #0000dd;">0</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array_.<span style="color: #007788;">resize</span><span style="color: #008000;">(</span>size, <span style="color: #0000dd;">0</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> result.<span style="color: #007788;">m_array</span>.<span style="color: #007788;">resize</span><span style="color: #008000;">(</span>size, <span style="color: #0000dd;">0</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span> <span style="color: #0000ff;">long</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;"><</span> size<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span> <span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> result.<span style="color: #007788;">m_array</span><span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000080;">=</span> <span style="color: #008000;">(</span>m_array_<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> other_<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> carry<span style="color: #008000;">)</span><span style="color: #000040;">%</span>BASE<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> carry <span style="color: #000080;">=</span> <span style="color: #008000;">(</span>m_array_<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> other_<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> carry<span style="color: #008000;">)</span><span style="color: #000040;">/</span>BASE<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">if</span> <span style="color: #008000;">(</span> carry <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #008000;">)</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> result.<span style="color: #007788;">m_array</span>.<span style="color: #007788;">push_back</span><span style="color: #008000;">(</span>carry<span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">return</span> result<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">void</span> output<span style="color: #008000;">(</span>ostream <span style="color: #000040;">&</span> out<span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">long</span> aSize <span style="color: #000080;">=</span> m_array.<span style="color: #007788;">size</span><span style="color: #008000;">(</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> out <span style="color: #000080;"><<</span> <span style="color: #0000ff;">static_cast</span><span style="color: #000080;"><</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">long</span><span style="color: #000080;">></span><span style="color: #008000;">(</span>m_array<span style="color: #008000;">[</span>aSize<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">]</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span> <span style="color: #0000ff;">long</span> i <span style="color: #000080;">=</span> aSize <span style="color: #000040;">-</span> <span style="color: #0000dd;">2</span><span style="color: #008080;">;</span> i <span style="color: #000080;">>=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000040;">--</span> <span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> ostringstream oss<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> oss <span style="color: #000080;"><<</span> m_array<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> string number <span style="color: #000080;">=</span> oss.<span style="color: #007788;">str</span><span style="color: #008000;">(</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">long</span> nSize <span style="color: #000080;">=</span> number.<span style="color: #007788;">size</span><span style="color: #008000;">(</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span> <span style="color: #0000ff;">long</span> j <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> j <span style="color: #000080;"><</span> LENGTH <span style="color: #000040;">-</span> nSize<span style="color: #008080;">;</span> j<span style="color: #000040;">++</span> <span style="color: #008000;">)</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> out <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"0"</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> out <span style="color: #000080;"><<</span> <span style="color: #0000ff;">static_cast</span><span style="color: #000080;"><</span><span style="color: #0000ff;">unsigned</span> <span style="color: #0000ff;">long</span><span style="color: #000080;">></span><span style="color: #008000;">(</span>m_array<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">private</span><span style="color: #008080;">:</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> vector<span style="color: #000080;"><</span>TYPE<span style="color: #000080;">></span> m_array<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">}</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> main<span style="color: #008000;">(</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt a<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>, b<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span>, c<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">long</span> n<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Vous voulez le n° : "</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cin</span> <span style="color: #000080;">>></span> n<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span> <span style="color: #0000ff;">long</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">2</span><span style="color: #008080;">;</span> i<span style="color: #000080;"><=</span>n<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span> <span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> c<span style="color: #000080;">=</span>b<span style="color: #000040;">+</span>a<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> a<span style="color: #000080;">=</span>b<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> b<span style="color: #000080;">=</span>c<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Voici : "</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> c.<span style="color: #007788;">output</span><span style="color: #008000;">(</span><span style="color: #0000dd;">cout</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">}</span></div></li></ol></pre>
Fibonacci.cpp
2010-01-13T22:39:50+01:00
http://codingteam.net/paste/show/573
jbell
http://codingteam.net/users/show/jbell
<pre class="cpp" style="font-family:monospace;"><ol><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include <iostream></span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define MAX 5000</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#define BASE 10</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> std<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">class</span> VeryLongInt <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">public</span><span style="color: #008080;">:</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt<span style="color: #008000;">(</span><span style="color: #0000ff;">int</span> init <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008000;">)</span> <span style="color: #008080;">:</span>m_array<span style="color: #008000;">(</span><span style="color: #0000ff;">NULL</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> <span style="color: #0000ff;">char</span> <span style="color: #008000;">[</span>MAX<span style="color: #008000;">]</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">long</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;"><</span>MAX<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span><span style="color: #000080;">=</span>init<span style="color: #000040;">%</span>BASE<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> init<span style="color: #000080;">=</span>init<span style="color: #000040;">/</span>BASE<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt<span style="color: #008000;">(</span><span style="color: #0000ff;">const</span> VeryLongInt <span style="color: #000040;">&</span> toCopy<span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> <span style="color: #0000ff;">char</span> <span style="color: #008000;">[</span>MAX<span style="color: #008000;">]</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">long</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;"><</span>MAX<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span><span style="color: #000080;">=</span>toCopy.<span style="color: #007788;">m_array</span><span style="color: #008000;">[</span>i<span style="color: #008000;">]</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> ~VeryLongInt<span style="color: #008000;">(</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">delete</span> m_array<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">const</span> VeryLongInt operator<span style="color: #000040;">+</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">const</span> VeryLongInt <span style="color: #000040;">&</span> other<span style="color: #008000;">)</span> <span style="color: #0000ff;">const</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt result<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">char</span> carry<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">long</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;"><</span>MAX<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> result.<span style="color: #007788;">m_array</span><span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000080;">=</span> <span style="color: #008000;">(</span>m_array<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> other.<span style="color: #007788;">m_array</span><span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> carry<span style="color: #008000;">)</span><span style="color: #000040;">%</span>BASE<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> carry<span style="color: #000080;">=</span><span style="color: #008000;">(</span>m_array<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> other.<span style="color: #007788;">m_array</span><span style="color: #008000;">[</span>i<span style="color: #008000;">]</span> <span style="color: #000040;">+</span> carry<span style="color: #008000;">)</span><span style="color: #000040;">/</span>BASE<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">return</span> result<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">const</span> VeryLongInt operator<span style="color: #000080;">=</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">const</span> VeryLongInt <span style="color: #000040;">&</span> other<span style="color: #008000;">)</span> <span style="color: #0000ff;">const</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">long</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000080;"><</span>MAX<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> m_array<span style="color: #008000;">[</span>i<span style="color: #008000;">]</span><span style="color: #000080;">=</span>other.<span style="color: #007788;">m_array</span><span style="color: #008000;">[</span>i<span style="color: #008000;">]</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">return</span> <span style="color: #000040;">*</span><span style="color: #0000dd;">this</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">void</span> output<span style="color: #008000;">(</span>ostream <span style="color: #000040;">&</span> out<span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">bool</span> nonZero<span style="color: #000080;">=</span><span style="color: #0000ff;">false</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span><span style="color: #0000ff;">long</span> i<span style="color: #000080;">=</span>MAX<span style="color: #008080;">;</span> i<span style="color: #000080;">></span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i<span style="color: #000040;">--</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">if</span> <span style="color: #008000;">(</span> m_array<span style="color: #008000;">[</span>i<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">]</span> <span style="color: #000040;">!</span><span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #000040;">||</span> nonZero <span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> out <span style="color: #000080;"><<</span> <span style="color: #0000ff;">static_cast</span><span style="color: #000080;"><</span><span style="color: #0000ff;">int</span><span style="color: #000080;">></span><span style="color: #008000;">(</span>m_array<span style="color: #008000;">[</span>i<span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">]</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> nonZero<span style="color: #000080;">=</span><span style="color: #0000ff;">true</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">private</span><span style="color: #008080;">:</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">char</span> <span style="color: #000040;">*</span> m_array<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">}</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> </div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #0000ff;">int</span> main<span style="color: #008000;">(</span><span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> VeryLongInt a<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span>, b<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span>, c<span style="color: #000080;">=</span><span style="color: #0000dd;">1</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">long</span> n<span style="color: #000080;">=</span><span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Vous voulez le n° : "</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cin</span> <span style="color: #000080;">>></span> n<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">for</span> <span style="color: #008000;">(</span> <span style="color: #0000ff;">long</span> i<span style="color: #000080;">=</span><span style="color: #0000dd;">2</span><span style="color: #008080;">;</span> i<span style="color: #000080;"><=</span>n<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span> <span style="color: #008000;">)</span> <span style="color: #008000;">{</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> c<span style="color: #000080;">=</span>b<span style="color: #000040;">+</span>a<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> a<span style="color: #000080;">=</span>b<span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> b<span style="color: #000080;">=</span>c<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #008000;">}</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> <span style="color: #FF0000;">"Voici : "</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> c.<span style="color: #007788;">output</span><span style="color: #008000;">(</span><span style="color: #0000dd;">cout</span><span style="color: #008000;">)</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000dd;">cout</span> <span style="color: #000080;"><<</span> endl<span style="color: #008080;">;</span></div></li><li style="background: #fcfcfc;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="background: #f0f0f0;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">}</span></div></li></ol></pre>