Search found 5 matches

by narsys
Sun Jun 19, 2005 4:36 am
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 61298

excuse me

I had changed my code before sent it and it was uncorrect
here is a correct code
#include <iostream>


using namespace std;


int main()
{

int num;
int number;
int count,i;
bool prime=true;



while (cin>>num && num!=0)
{
int answer[50];
number=num;
count = 1;
// prime=true;

if(num<0 ...
by narsys
Sat Jun 18, 2005 6:50 am
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 61298

583 (prime factor prob) TLE

hey I use this simple and clear algorithm but get TLE (Can I use array with prime numbers to get AC?) I don't want this solution.Is there another way other that.
Excuse me it is not correct I send the correct one in third post
#include <iostream>

using namespace std;


int main()
{

int num;
int ...
by narsys
Sun Jun 12, 2005 4:28 am
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 34294

I find Problem

It occurs when your program want this: x/0 (divide number by 0)
I write another code that work efficient and simpler and get AC

0 0.0
by narsys
Fri Jun 10, 2005 6:36 pm
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 34294

Help with 332 (correct but ...)

Your program has died with signal 8 (SIGFPE). Meaning:

Floating point exception

In my computer it work
my code is:
#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main()
{
string num;
int repeated;
int noRepeatedNum=0;
int i,length,dotPosition=0,counter=0;
int ...
by narsys
Thu Jun 09, 2005 6:32 am
Forum: C++
Topic: Can I use cmath header? Why ...
Replies: 2
Views: 1833

Can I use cmath header? Why ...

My English is not good (excuse me for mistakes)
I wanted to use pow function in my code I used cmath header file (#include <cmath>) but I got WA. I submitted my code several time but got WA . I wrote my own power function I got Accept Answer.

Go to advanced search