Home > Back-end >  Bosses, teach children
Bosses, teach children

Time:05-21

O four natural Numbers a, b, c, d (a<=b<=c<=d), makes the following equation was established: 1/a + 1 + 1/+ 1 b/c/d=1
Using C language to complete, thank you

CodePudding user response:

 float a=4, b=4, c=4, d=4; 

Finish the manual

CodePudding user response:

 # include & lt; stdio.h> 
#include
#include

Int main (void)
{
Int I, j, k, z;
Float x;

For (I=1; ; I++)
For (j=1; J & lt;=I; J++)
For (k=1; K & lt;=j; K++)
For (z=1; Z & lt;=k; Z++) {
X=1.0/I/j/k + 1.0 + 1.0 + 1.0)/z;

If (fabsf (x - 1) & lt; 1-6 e) {
Printf (" % d, % d, % d, % d \ n ", I, j, k, z);
Printf (" % 2 f + %. 2 f + %. 2 f + %. 2 f=%. 2 f \ n ", 1.0/I/j, 1.0 1.0/k, 1.0/z, x);
sleep(1);
//return 0;
}
}

return 0;
}

For your reference ~

The output of the sleep need to wait for one ~

CodePudding user response:

thank you

CodePudding user response:


This is what ah
crying

CodePudding user response:

reference 4 floor qq_57019597 response:

This is what ah
Crying

The header file: under Windows - & gt; Windows. J h, Sleep is a case-sensitive, some compilers are capitalized, have a plenty of lowercase,

Line 2: # include Row 19: Sleep (1);
Line 16, the if (fabs) (x - 1 & lt; 1-6 e) {