My question is "Quality and weight ". I used to forget about physical mathematics.
So I came to handle it as I said this:
In general, the weight is called quality in quality, expressed in m, the volume is expressed in V, and the density is expressed in P
When the volume and density are known, the following formula can be used for calculation.
M = P V
That is, mass = density x volume
Here, I can understand the computation in the book!
Take another look:
Weight = Volume * density * g (G indicates that the gravity acceleration is not gram, generally 9.8)
Mass = Volume * density
I just want to say that what I learned in the past is still classic. Unfortunately, if I didn't learn C, I would not pick it up!
C ++ code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
# Include <stdio. h> # Include <string. h> # Include <windows. h> # Define density 62.4
// Density -- Density // Volume-volume and capacity // Letters -- Letter (number) // Cubic feet -- cube Int main (void) { Float weight, volume; Int size, letters; Char name [40];
Printf ("Hi! What's your first name? \ N "); Scanf ("% s", name ); Printf ("% s, what's your weight in pounds? \ N ", name ); Scanf ("% F", & weight );
Size = sizeof name; Letters = strlen (name ); Volume = weight/density; // the core issue is that you do not know the formula!
Printf ("Well, % s, your volume is % 2.2f cubic feet. \ n", name, volume ); Printf ("also, your first name has % d letters,", letters ); Printf ("and we have % d bytes to store it in. \ n", size );
// Sleep (1000*10); // are there other similar functions? Return 0; }
|
Talkback. c