Output formula

xiaoxiao2021-03-05  25

Norm A = {1, 1, 3, 7, 17, 41, `` `} The following nature:

A0 = a1 = 1; AI = Ai-2 2 * ai-1 (i> = 2)

For a given N, the number of columns XN has n elements, each element is ai / Ai 1 (i = 0, 1, `` ``) and arranged in ascending order. The elements of XN are represented in the form of fraction; the function HA () first generates an element of XN when the element of the enumeration number A, then sorts the elements of XN, and the elements of the sorted XN are sequenced. Example: When n = 5, x5 = {1/3, 7/17, 17/41, 3/7, 1/1} ==================== ============================================================================================================================================================================================================= ===========

#include #include #include

FLOAT Array (INT N) {IF (n == 1 || n == 0) Return 1.0; Else Return Array (N-2) 2 * Array (N-1);}

Void makex (float b [], int m) {float hold; int 1, j; for (i = 0; i B [J]) {HOLD = B [I]; B [i] = B [J]; B [J] = Hold;}}

INT main () {INT I, N; FLOAT A [100]; Printf ("Input the number:"); scanf ("% d", & n); printf ("/ n"); Makex (A, N) For (i = 0; i

转载请注明原文地址:https://www.9cbs.com/read-35634.html

New Post(0)