Search found 1 match

by minipada
Wed Mar 23, 2011 10:36 pm
Forum: Volume 8 (800-899)
Topic: 880 - Cantor Fractions
Replies: 24
Views: 17249

880 Cantor fractions

Hi, i made it in C: #include <stdio.h> void cantor(int x) { int i = 0; int somme = 0; int max; while (somme < x){ somme = somme + i; i++; } somme = somme - i +2; i = somme; for(max = 1; somme-max > 0; max++) somme = somme-max; printf("%d/%d\n",max-x+i,1+x-i); } int main() { int x; while (scanf("%d",...

Go to advanced search