Talkback. c

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.