<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<!-- DOMjudge version 3.3.2 -->
<title>Source: s888</title>
<link rel="shortcut icon" href="../images/favicon.png" type="image/png" />
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="stylesheet" href="style_jury.css" type="text/css" />
<script type="text/javascript" src="../js/sorttable.js"></script>
<script type="text/javascript" src="../js/domjudge.js"></script>
</head>
<body>

<h2>Source code for submission s888</h2>

<p><a href="#diff">Go to diff to previous submission</a></p>

<div class="tabber"><div class="tabbertab"><h2 class="filename"><a name="source0"></a>mosquito.cpp</h2> 

<pre class="cpp" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include&lt;iostream&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339900;">#include&lt;cstdio&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><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="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><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;">&#40;</span> <span style="color: #0000ff;">void</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #0000ff;">int</span> mosq, mosqB, pupae, larve, eggnum, larvesur, pupaesur, weeks<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    mosqB <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><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;">&#40;</span> <span style="color: #0000dd;">cin</span> <span style="color: #000080;">&gt;&gt;</span> mosq <span style="color: #000080;">&gt;&gt;</span> pupae <span style="color: #000080;">&gt;&gt;</span> larve <span style="color: #000080;">&gt;&gt;</span> eggnum <span style="color: #000080;">&gt;&gt;</span> larvesur <span style="color: #000080;">&gt;&gt;</span> pupaesur <span style="color: #000080;">&gt;&gt;</span> weeks <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: bold; vertical-align:top;"><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;">&#40;</span> <span style="color: #0000ff;">int</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> weeks<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span> <span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #008000;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            mosqB <span style="color: #000080;">=</span> mosq<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            mosq <span style="color: #000080;">=</span> pupae <span style="color: #000040;">/</span> pupaesur<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            pupae <span style="color: #000080;">=</span> larve <span style="color: #000040;">/</span> larvesur<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><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;">&#40;</span> larve <span style="color: #000040;">%</span> larvesur <span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                pupae<span style="color: #000040;">++</span><span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            larve <span style="color: #000080;">=</span> mosqB <span style="color: #000040;">*</span> eggnum<span style="color: #008080;">;</span>            </div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><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;">&#40;</span> weeks <span style="color: #000040;">%</span> <span style="color: #0000dd;">2</span> <span style="color: #008000;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><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;">&lt;&lt;</span> mosq <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #0000ff;">else</span></div></li><li style="font-weight: bold; vertical-align:top;"><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;">&lt;&lt;</span> mosqB <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #008000;">&#125;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">&#125;</span></div></li></ol></pre></div></div><h2><a name="diff"></a>Diff to submission <a href="866">s866</a></h2>
<div class="tabber"><div class="tabbertab"><h2 class="filename"><a name="diff"></a>mosquito.cpp</h2>

<pre class="output_text"><span class='diff-del'>--- c4.s866.cteam017.mosquito.cpp.0.mosquito.cpp</span>
<span class='diff-add'>+++ c4.s888.cteam017.mosquito.cpp.0.mosquito.cpp</span>
@@ -6,4 +6,5 @@
 int main( void ) {
     int mosq, mosqB, pupae, larve, eggnum, larvesur, pupaesur, weeks;
<span class='diff-add'>+    mosqB = 0;</span>
     while ( cin &gt;&gt; mosq &gt;&gt; pupae &gt;&gt; larve &gt;&gt; eggnum &gt;&gt; larvesur &gt;&gt; pupaesur &gt;&gt; weeks ) {
         for ( int i = 0; i &lt; weeks; i++ )
@@ -19,6 +20,8 @@
             larve = mosqB * eggnum;            
         }
<span class='diff-del'>-        </span>
<span class='diff-del'>-        cout &lt;&lt; mosq &lt;&lt; endl;</span>
<span class='diff-add'>+        if ( weeks % 2 )</span>
<span class='diff-add'>+            cout &lt;&lt; mosq &lt;&lt; endl;</span>
<span class='diff-add'>+        else</span>
<span class='diff-add'>+            cout &lt;&lt; mosqB &lt;&lt; endl;</span>
     }
 }
\ No newline at end of file
</pre>

</div></div>
</body>
</html>
