Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n = 4;
- int tc = 3;
- double g = 9.8;
- double h = 0.7;
- double d = 0.046;
- double m[] = { 0.047 + 0.220, 0.047 + 0.220 * 2, 0.047 + 0.220 * 3, 0.047 + 0.220 * 4 };
- int main() {
- double t;
- for (int i = 0; i < 6; i++) {
- cout << (i + 1) << " r -------------" << endl;
- for (int j = 0; j < n; j++) {
- double dt = 0;
- for (int k = 0; k < tc; k++) {
- cout << "t" << k + 1 << " = ";
- cin >> t;
- dt += t / tc;
- }
- double E = 4 * h / dt / dt / d;
- double M = m[j] * d / 2 * (g - 2 * h / dt / dt);
- cout << "dT = " << dt << endl;
- cout << "E = " << E << endl;
- cout << "M = " << M << endl;
- cout << endl;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment