Source code for submission s631

Go to diff to previous submission

mosquito.cpp

  1. #include <iostream>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. using namespace std;
  6.  
  7. int main(void) {
  8. int M,P,L,E,R,S,N,dump;
  9. while(scanf("%d %d %d %d %d %d %d",&M, &P, &L, &E, &R, &S, &N) == 7) {
  10. for (int i=1; i<=N; i++) {
  11. dump = L;
  12. L = M*E;
  13. M = P/S;
  14. P = dump/R;
  15. }
  16. cout << M << endl;
  17. }
  18.  
  19. return 0;
  20. }
  21.  

Diff to submission s607

mosquito.cpp

--- c4.s607.cteam001.mosquito.cpp.0.mosquito.cpp
+++ c4.s631.cteam001.mosquito.cpp.0.mosquito.cpp
@@ -6,11 +6,11 @@
 
 int main(void) {
-   int M,P,L,E,R,S,N;
+   int M,P,L,E,R,S,N,dump;
    while(scanf("%d %d %d %d %d %d %d",&M, &P, &L, &E, &R, &S, &N) == 7) {
       for (int i=1; i<=N; i++) {
-          N--;
+          dump = L;
           L = M*E;
           M = P/S;
-          P = L/R;          
+          P = dump/R;          
       }
       cout << M << endl;