Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
0% Quality Score
Upvotes Received
0
Posts with Upvotes
0
Upvoting Members
0
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
0 Endorsements
Ranked #4K
~6K People Reached
Favorite Tags
Member Avatar for Petcheco

Hello, friends. I did the fourth challenge on Project Euler and I'd like to know what I can do to improve the efficiency of my code. Right now it takes 1.562s to run and the source code is as follows: #include <iostream> #include <string.h> using namespace std; int Number = …

Member Avatar for memson
0
411
Member Avatar for markdean1989

Why is it that whenever I use the getline function I get an error during execution. To clarify... I have this code; cout<<"Enter your string: "; getline(cin, myString); //line 1 cout<<"Enter your name: "; getline(cin, myName); //line 2 cout<<"Age: "; cin>>age; //line 3 output: ____________________________ Enter your string: gfgfkjhjkhgg Enter …

Member Avatar for David W
0
2K
Member Avatar for Petcheco

Hey, guys. Find the sum of all the primes below 2000000. My code: *main.cpp* #include <iostream> #include <vector> #include <cmath> #include "Sieve.h" using namespace std; typedef unsigned long long int ulli; ulli Sum = 0; ulli Sum_of_Primes(vector<bool>, ulli&); ulli Sum_of_Primes(vector<bool> Primes, ulli& Sum) { for(ulli a = 2; a < …

Member Avatar for Petcheco
0
410
Member Avatar for Petcheco

Hey, guys. A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a² + b² = c². For example, 3² + 4² = 9 + 16 = 25 = 5². There exists exactly one Pythagorean triplet for which a + b + c …

Member Avatar for Petcheco
0
345
Member Avatar for Petcheco

Hello, guys. How would I deal with a variable that needs to be biggers than an unsigned long long integer? Thank you.

Member Avatar for Petcheco
0
192
Member Avatar for Petcheco

Hello, guys. This challenge asks us to find the 10001-th prime. Here's my code: // A reasonable approximation is to say that the n-th prime is such that p(n) = n*(log n + log*(log n) - 1). // With that in mind, we can say that the 10001-th prime is …

Member Avatar for Petcheco
0
252
Member Avatar for CattleOfRa

I've just started learning C++ on Linux. I have written a very small program which compiles but I get run time errors everytime I run it. The code is shown below: #include<iostream> int DoubleOf(int n); int main() { std::cout << "Double of 5 is " << DoubleOf(5); return 0; } …

Member Avatar for sepp2k
0
190
Member Avatar for Petcheco

Hello, guys. The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. 73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 12540698747158523863050715693290963295227443043557 66896648950445244523161731856403098711121722383113 62229893423380308135336276614282806444486645238749 30358907296290491560440772390713810515859307960866 70172427121883998797908792274921901699720888093776 65727333001053367881220235421809751254540594752243 52584907711670556013604839586446706324415722155397 53697817977846174064955149290862569321978468622482 83972241375657056057490261407972968652414535100474 82166370484403199890008895243450658541227588666881 16427171479924442928230863465674813919123162824586 17866458359124566529476545682848912883142607690042 24219022671055626321111109370544217506941658960408 07198403850962455444362981230987879927244284909188 84580156166097919133875499200524063689912560717606 05886116467109405077541002256983155200055935729725 71636269561882670428252483600823257530420752963450 Find the thirteen adjacent digits …

Member Avatar for Petcheco
0
288
Member Avatar for Petcheco

Hello, guys. Here's the challenge: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? I wrote my code: #include …

Member Avatar for Petcheco
0
319
Member Avatar for Fernando_7

Hey guys I need a push in the right direction im confused on how to iterate through this string "feeenhpoorilumayngtumseatsdmepotositnsfrlerruepsrennurdaorantiedbeunrtioradarahe" frontwords and backwards a push in the right would be pleasent if anyone can help

Member Avatar for Petcheco
0
104
Member Avatar for Petcheco

Hello, guys. I've wrote the following code #include <iostream> #include <string.h> #include <string> #include <locale> #include <stdio.h> #include <stdlib.h> #include <limits> #include <vector> #include <windows.h> using namespace std; string Numero_de_Matricula = ""; string Nome = ""; int Numero_de_Materias = 0; int Numero_de_Creditos = 0; vector<double> creditos (10); vector<double> Coeficientes(10); double …

Member Avatar for Petcheco
0
131
Member Avatar for Petcheco

Hello, guys. I wrote the code to a Quadratic Equations Solver and I'd like for you to run the program and read the source code and give me tips on what I can improve, what is good and what is bad, suggestions, etc. . #include <iostream> #include <locale.h> #include <math.h> …

Member Avatar for Petcheco
0
275
Member Avatar for jamewatsn

Hi everyone.... I am new member here... I wanna be your friend, guys.... Hi I'm Jame watson nd I'm From Los Angeles

Member Avatar for forrestanderson
0
46
Member Avatar for TonyG_cyprus

Don't you find it frustrating when someone starts a thread and requests help with code that they obviously haven't checked? "I've created this code" really gets up my nose when the comment lines( such as '// enter your words here') show that it's just been copied from somewhere. Download a …

Member Avatar for mike_2000_17
2
111
Member Avatar for Petcheco

Hello everyone. I saw a post of one of our friends here about a problem he found of the SPOJ website. So I went there to check it. I found it to be very cool; I started to do the exercises but when I got in the 2nd, a prime …

Member Avatar for Petcheco
0
203
Member Avatar for Petcheco

Hello everyone, my name is Petcheco and I've been coding C and C++ codes for a while. I already came to this website a couple times and I think it's great. It's a pleasure to meet you all and I hope I can assist and be assisted as much as …

Member Avatar for Petcheco
0
82