Search found 2 matches

by kfree
Wed Aug 13, 2003 9:31 am
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 34212



#include <stdio.h>
#include <math.h>

int main() {
double x, y;
int k, j, i, a, b, c=1;

scanf("%d %lf", &j, &x);
while (j != -1) {
y = x * pow(10, j);
for (k=0; y != (double)((long)y); y*=10,k++);
a = (int)(pow(10, k+j)*x) - (int)(pow(10,k)*x);
b = pow(10, k+j) - pow(10,k);
for (i=a<b ...
by kfree
Wed Aug 06, 2003 9:32 am
Forum: Algorithms
Topic: Let's talk about Backtracking
Replies: 1
Views: 2460

:P
Backtracking is a basis algorithm for solve UVA problem.
It have algorithm framework,you could refer to some books.for example,《The Algorithm Design Manual》
URL http://www.darkridge.com/~jpr5/archive/alg/node1.html

[c]#include <stdio.h>
int n;
int nLoop[21];
int beUsed[21];
int isPrime[40]={0 ...

Go to advanced search