Hey guys.
I don't know why I'm getting OLE from my code. I don't seem to encounter any infinite loops whatsoever...
Also what happens if you put in '1' ? Is it just 1 = 1?
Help appreciated :)
[cpp]#include <stdio.h>
#include <math.h>
bool *primes;
long c=46341;
long nextprime(long i)
{
for ...
Search found 5 matches
- Thu Apr 01, 2004 4:38 pm
- Forum: Volume 5 (500-599)
- Topic: 583 - Prime Factors
- Replies: 171
- Views: 61187
- Thu Mar 11, 2004 10:35 am
- Forum: Volume 4 (400-499)
- Topic: 489 - Hangman Judge
- Replies: 52
- Views: 23824
- Wed Mar 10, 2004 2:58 pm
- Forum: Volume 4 (400-499)
- Topic: 489 - Hangman Judge
- Replies: 52
- Views: 23824
- Wed Mar 10, 2004 2:39 pm
- Forum: Volume 4 (400-499)
- Topic: 489 - Hangman Judge
- Replies: 52
- Views: 23824
489 Compile Error??!
[cpp]#include <iostream>
#include <string>
using namespace std;
int search(const char &a,const string &s)
{
for (int i=0;i<s.length();i++)
if (s ==a) return i;
return -1;
}
inline int process(const string &s)
{
string temp; temp+=s[0];
for (int i=1;i<s.length();i++)
if (s[i-1]!=s && search ...
#include <string>
using namespace std;
int search(const char &a,const string &s)
{
for (int i=0;i<s.length();i++)
if (s ==a) return i;
return -1;
}
inline int process(const string &s)
{
string temp; temp+=s[0];
for (int i=1;i<s.length();i++)
if (s[i-1]!=s && search ...
- Tue Mar 09, 2004 11:22 am
- Forum: Volume 104 (10400-10499)
- Topic: 10450 - World Cup Noise
- Replies: 42
- Views: 27223
10450 WA - why?
Hey guys, I did the World Cup problem and did figure out why the answer was a Fibonacci number. So i coded this...
[cpp]
#include <iostream>
#include <math.h>
using namespace std;
long long fibo(int x)
{
return (long long)((pow((1+sqrt(5.))/2,x)-pow((1-sqrt(5.))/2,x))/sqrt(5.));
}
int main ...
[cpp]
#include <iostream>
#include <math.h>
using namespace std;
long long fibo(int x)
{
return (long long)((pow((1+sqrt(5.))/2,x)-pow((1-sqrt(5.))/2,x))/sqrt(5.));
}
int main ...