Search found 3 matches

by marco2509
Thu Oct 29, 2009 7:16 am
Forum: Volume 8 (800-899)
Topic: 880 - Cantor Fractions
Replies: 24
Views: 17300

Re: 880 - Cantor Fractions

Where is the mistake?

Code: Select all

#include <stdio.h>
#include <math.h>
int main() {
	unsigned long int k, r, n;
	while(scanf("%u",&n) != EOF) {
  	k = (unsigned long int)(sqrt(2 * n) + 0.5);
   	r = k * (k + 1)/ 2 - n;
   	printf("%u/%u\n",1+r,k-r);
	}
	return 0;
}
by marco2509
Thu Oct 29, 2009 12:20 am
Forum: Volume 8 (800-899)
Topic: 847 - A Multiplication Game
Replies: 41
Views: 20132

Re: 847 - A Multiplication Game

Why I received runtime error.Remember to always terminate your code with the exit code 0. #include <stdio.h> #include <string.h> #include <math.h> #include <iostream.h> unsigned int n; char w[33][23][15][13]; char getwin( int two,int three,int five,int seven ){ if ( w[two][three][five][seven] != -1 ...
by marco2509
Wed Oct 28, 2009 11:08 pm
Forum: Volume 8 (800-899)
Topic: 884 - Factorial Factors
Replies: 49
Views: 26932

Re: 884 - Factorial Factors

I need help with my code, I don't know where is the mistake, I received "Factorial Factors has failed with verdict Time limit exceeded". I think is the input. #include <stdio.h> #include <stdlib.h> using namespace std; long int *array; void primos(long int numero) { int factor = 2; while(numero >= f...

Go to advanced search