Challenges

Posts 16–27 of 27 · Page 2 of 2
oh, well, i had a different thought process. Plus i like to spread out my work. That's some really nice code though. Good job.
Quote Originally Posted by 258456 View Post
oh, well, i had a different though process. Plus i like to spread out my work. That's some really nice code though. Good job.
Thanks ;D
Quote Originally Posted by Lyoto Machida View Post


I did the first and the second one, In like 5 lines ..

But i cant do more, cause my english sucks, + math, i cant
Damn you suck at math?
Quote Originally Posted by whit View Post
Damn you suck at math?
No that mutch.
The problem is: i cant understand english math
Quote Originally Posted by Cal View Post
Make a hack
What ? .

Quote Originally Posted by Lyoto Machida View Post


No that mutch.
The problem is: i cant understand english math
Ahh yes you in Brazil They teach weird math over there
Quote Originally Posted by whit View Post
What ? .



Ahh yes you in Brazil They teach weird math over there
Actually im in Portugal , And its because its hard to understand the problems in english, and google translate sucks :/
Make a hack
what's wrong with my code for number #2


Code:

#include <iostream>
#include <fstream>
using namespace std;

int main()

{
    ofstream myfile;
    myfile.open("fib.txt");
    
      
      int n,  second_term = 0,  previous_term = 1 , term_now,  ;
      long long sum_actual = 0, sum = 0;
      for   (n = 0; n<4000001; n++)
      {
           
           sum = previous_term + second_term ;
           
           
           
            
           previous_term = second_term;
           second_term = sum;
           
           if(sum % 2 == 0) { sum_actual += sum; }
           
          
      }
      myfile << sum_actual;
      myfile.close();
    cout<<sum_actual;
    cin.get();
    
    return 0;
    
}
Quote Originally Posted by 258456 View Post
what's wrong with my code for number #2


Code:

#include <iostream>
#include <fstream>
using namespace std;

int main()

{
    ofstream myfile;
    myfile.open("fib.txt");
    
      
      int n,  second_term = 0,  previous_term = 1 , term_now,  ;
      long long sum_actual = 0, sum = 0;
      for   (n = 0; n<4000001; n++)
      {
           
           sum = previous_term + second_term ;
           
           
           
            
           previous_term = second_term;
           second_term = sum;
           
           if(sum % 2 == 0) { sum_actual += sum; }
           
          
      }
      myfile << sum_actual;
      myfile.close();
    cout<<sum_actual;
    cin.get();
    
    return 0;
    
}
Idk..

Code:
int n1 = 1, n2 = 2, itemp, itotal = 2;
	while(n2 <= 4000000){
		itemp = n1 + n2;
		n1 = n2;  n2 = itemp;
		if(n2 % 2 == 0){ itotal += n2;}
	} cout << itotal << endl;
Its something like that..try it
nope didn't work
Edited my post did you saw?
It worked here, just tried...
i have the best site for you: ::[ www.try2hack.nl ]::

yeah the first few levels are easy but the further it goes the harder it gets.
Posts 16–27 of 27 · Page 2 of 2

Post a Reply

Tags for this Thread

None

Talk with us