Во-первых в начале НЕ сin << sys, а сin >> s;
Во-вторых ты объявил/а все переменные в первом ифе, а значит в других функциях они уже не видны, поэтому стоит их объявить глобально
В-третьих переменная g не используется, поэтому можно ее и не объявлять
Вот код:
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int sys;
float a, b, c, d, e, sum, mid, pi=3.14, r;
cout << "if you would midle write-1, if place of circle-2" << endl;
cin >> sys;
if(sys == 1) {
cout << "input first midle" << endl;
cin >> a;
cout << "inpur second midle" << endl;
cin >> b;
cout << "input third midle" << endl;
cin >> c;
cout << "input thord midle" << endl;
cin >> d;
cout << "input fived midle" << endl;
cin >> e;
sum = a + b + c + d + e;
mid = sum / 5;
cout << "your midle: ";
cout << mid;
}
else{
if(sys == 2) {
cout << "this is the circle area formula S=pi*r^2" << endl;
cout << "input radius(r)" << endl;
cin >> r;
cout << pi * r * r;
return 0;
1.
156₁₀ = 6*10⁰ + 5*10¹ + 1*10²
236₈ = 6*8⁰ + 3*8¹ + 2*8²
185,463₁₀ = 5*10⁰ + 8*10¹ + 1*10² + 4/10¹ + 6/10² + 3/10³
2013,125₈ = 3*8⁰ + 1*8¹ + 0*8² + 2*8³ + 1/10¹ + 2/10² + 5/10³
2.
123₁₀ = 1111011₂ = 173₈ = 7B₁₆
456₁₀ = 111001000₂ = 710₈ = 1C8₁₆
234₁₀ = 11101010₂ = 352₈ = EA₁₆
256₁₀ = 100000000₂ = 400₈ = 100₁₆
3.
101001₂ + 1111₂ = 111000₂ = 70₈ = 38₁₆
11111₂ + 111₂ = 100110₂ = 46₈ = 26₁₆
111₂ * 110₂ = 101010₂ = 52₈ = 2A₁₆
101₂ * 111₂ = 100011₂ = 43₈ = 23₁₆
Объяснение:
123₁₀ = 1*2⁰ + 1*2¹ + 0*2² + 1*2³ + 1*2⁴ + 1*2⁵ + 1*2⁶ = 1111011₂
123₁₀ = 3*8⁰ + 7*8¹ + 1*8² = 173₈
123₁₀ = 11*16⁰ + 7*16¹ = 7B₁₆
7B₁₆ = B*16⁰ + 7*16¹ = 123₁₀
456₁₀ = 0*2⁰ + 0*2¹ + 0*2² + 1*2³ + 0*2⁴ + 0*2⁵ + 1*2⁶ + 1*2⁷ + 1*2⁸ = 111001000₂
456₁₀ = 0*8⁰ + 1*8¹ + 7*8² = 710₈
456₁₀ = 8*16⁰ + 12*16¹ + 1*16² = 1C8₁₆
1C8₁₆ = 8*16⁰ + C*16¹ + 1*16² = 456₁₀
234₁₀ = 0*2⁰ + 1*2¹ + 0*2² + 1*2³ + 0*2⁴ + 1*2⁵ + 1*2⁶ + 1*2⁷ = 11101010₂
234₁₀ = 2*8⁰ + 5*8¹ + 3*8² = 352₈
234₁₀ = 10*16⁰ + 14*16¹ = EA₁₆
EA₁₆ = A*16⁰ + E*16¹ = 234₁₀
256₁₀ = 0*2⁰ + 0*2¹ + 0*2² + 0*2³ + 0*2⁴ + 0*2⁵ + 0*2⁶ + 0*2⁷ + 1*2⁸ = 100000000₂
256₁₀ = 0*8⁰ + 0*8¹ + 4*8² = 400₈
256₁₀ = 0*16⁰ + 0*16¹ + 1*16² = 100₁₆
100₁₆ = 0*16⁰ + 0*16¹ + 1*16² = 256₁₀
101001₂ = 1*2⁰ + 0*2¹ + 0*2² + 1*2³ + 0*2⁴ + 1*2⁵ = 41₁₀
1111₂ = 1*2⁰ + 1*2¹ + 1*2² + 1*2³ = 15₁₀
56₁₀ = 0*8⁰ + 7*8¹ = 70₈
56₁₀ = 8*16⁰ + 3*16¹ = 38₁₆
11111₂ = 1*2⁰ + 1*2¹ + 1*2² + 1*2³ + 1*2⁴ = 31₁₀
111₂ = 1*2⁰ + 1*2¹ + 1*2² = 7₁₀
38₁₀ = 6*8⁰ + 4*8¹ = 46₈
38₁₀ = 6*16⁰ + 2*16¹ = 26₁₆
110₂ = 0*2⁰ + 1*2¹ + 1*2² = 6₁₀
42₁₀ = 2*8⁰ + 5*8¹ = 52₈
42₁₀ = 10*16⁰ + 2*16¹ = 2A₁₆
101₂ = 1*2⁰ + 0*2¹ + 1*2² = 5₁₀
35₁₀ = 3*8⁰ + 4*8¹ = 43₈
35₁₀ = 3*16⁰ + 2*16¹ = 23₁₆
Во-первых в начале НЕ сin << sys, а сin >> s;
Во-вторых ты объявил/а все переменные в первом ифе, а значит в других функциях они уже не видны, поэтому стоит их объявить глобально
В-третьих переменная g не используется, поэтому можно ее и не объявлять
Вот код:
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int sys;
float a, b, c, d, e, sum, mid, pi=3.14, r;
cout << "if you would midle write-1, if place of circle-2" << endl;
cin >> sys;
if(sys == 1) {
cout << "input first midle" << endl;
cin >> a;
cout << "inpur second midle" << endl;
cin >> b;
cout << "input third midle" << endl;
cin >> c;
cout << "input thord midle" << endl;
cin >> d;
cout << "input fived midle" << endl;
cin >> e;
sum = a + b + c + d + e;
mid = sum / 5;
cout << "your midle: ";
cout << mid;
}
else{
if(sys == 2) {
cout << "this is the circle area formula S=pi*r^2" << endl;
cout << "input radius(r)" << endl;
cin >> r;
cout << pi * r * r;
}
}
return 0;
}
1.
156₁₀ = 6*10⁰ + 5*10¹ + 1*10²
236₈ = 6*8⁰ + 3*8¹ + 2*8²
185,463₁₀ = 5*10⁰ + 8*10¹ + 1*10² + 4/10¹ + 6/10² + 3/10³
2013,125₈ = 3*8⁰ + 1*8¹ + 0*8² + 2*8³ + 1/10¹ + 2/10² + 5/10³
2.
123₁₀ = 1111011₂ = 173₈ = 7B₁₆
456₁₀ = 111001000₂ = 710₈ = 1C8₁₆
234₁₀ = 11101010₂ = 352₈ = EA₁₆
256₁₀ = 100000000₂ = 400₈ = 100₁₆
3.
101001₂ + 1111₂ = 111000₂ = 70₈ = 38₁₆
11111₂ + 111₂ = 100110₂ = 46₈ = 26₁₆
111₂ * 110₂ = 101010₂ = 52₈ = 2A₁₆
101₂ * 111₂ = 100011₂ = 43₈ = 23₁₆
Объяснение:
2.
123₁₀ = 1*2⁰ + 1*2¹ + 0*2² + 1*2³ + 1*2⁴ + 1*2⁵ + 1*2⁶ = 1111011₂
123₁₀ = 3*8⁰ + 7*8¹ + 1*8² = 173₈
123₁₀ = 11*16⁰ + 7*16¹ = 7B₁₆
7B₁₆ = B*16⁰ + 7*16¹ = 123₁₀
123₁₀ = 3*8⁰ + 7*8¹ + 1*8² = 173₈
123₁₀ = 1*2⁰ + 1*2¹ + 0*2² + 1*2³ + 1*2⁴ + 1*2⁵ + 1*2⁶ = 1111011₂
456₁₀ = 0*2⁰ + 0*2¹ + 0*2² + 1*2³ + 0*2⁴ + 0*2⁵ + 1*2⁶ + 1*2⁷ + 1*2⁸ = 111001000₂
456₁₀ = 0*8⁰ + 1*8¹ + 7*8² = 710₈
456₁₀ = 8*16⁰ + 12*16¹ + 1*16² = 1C8₁₆
1C8₁₆ = 8*16⁰ + C*16¹ + 1*16² = 456₁₀
456₁₀ = 0*8⁰ + 1*8¹ + 7*8² = 710₈
456₁₀ = 0*2⁰ + 0*2¹ + 0*2² + 1*2³ + 0*2⁴ + 0*2⁵ + 1*2⁶ + 1*2⁷ + 1*2⁸ = 111001000₂
234₁₀ = 0*2⁰ + 1*2¹ + 0*2² + 1*2³ + 0*2⁴ + 1*2⁵ + 1*2⁶ + 1*2⁷ = 11101010₂
234₁₀ = 2*8⁰ + 5*8¹ + 3*8² = 352₈
234₁₀ = 10*16⁰ + 14*16¹ = EA₁₆
EA₁₆ = A*16⁰ + E*16¹ = 234₁₀
234₁₀ = 2*8⁰ + 5*8¹ + 3*8² = 352₈
234₁₀ = 0*2⁰ + 1*2¹ + 0*2² + 1*2³ + 0*2⁴ + 1*2⁵ + 1*2⁶ + 1*2⁷ = 11101010₂
256₁₀ = 0*2⁰ + 0*2¹ + 0*2² + 0*2³ + 0*2⁴ + 0*2⁵ + 0*2⁶ + 0*2⁷ + 1*2⁸ = 100000000₂
256₁₀ = 0*8⁰ + 0*8¹ + 4*8² = 400₈
256₁₀ = 0*16⁰ + 0*16¹ + 1*16² = 100₁₆
100₁₆ = 0*16⁰ + 0*16¹ + 1*16² = 256₁₀
256₁₀ = 0*8⁰ + 0*8¹ + 4*8² = 400₈
256₁₀ = 0*2⁰ + 0*2¹ + 0*2² + 0*2³ + 0*2⁴ + 0*2⁵ + 0*2⁶ + 0*2⁷ + 1*2⁸ = 100000000₂
3.
101001₂ = 1*2⁰ + 0*2¹ + 0*2² + 1*2³ + 0*2⁴ + 1*2⁵ = 41₁₀
1111₂ = 1*2⁰ + 1*2¹ + 1*2² + 1*2³ = 15₁₀
56₁₀ = 0*8⁰ + 7*8¹ = 70₈
56₁₀ = 8*16⁰ + 3*16¹ = 38₁₆
11111₂ = 1*2⁰ + 1*2¹ + 1*2² + 1*2³ + 1*2⁴ = 31₁₀
111₂ = 1*2⁰ + 1*2¹ + 1*2² = 7₁₀
38₁₀ = 6*8⁰ + 4*8¹ = 46₈
38₁₀ = 6*16⁰ + 2*16¹ = 26₁₆
111₂ = 1*2⁰ + 1*2¹ + 1*2² = 7₁₀
110₂ = 0*2⁰ + 1*2¹ + 1*2² = 6₁₀
42₁₀ = 2*8⁰ + 5*8¹ = 52₈
42₁₀ = 10*16⁰ + 2*16¹ = 2A₁₆
101₂ = 1*2⁰ + 0*2¹ + 1*2² = 5₁₀
111₂ = 1*2⁰ + 1*2¹ + 1*2² = 7₁₀
35₁₀ = 3*8⁰ + 4*8¹ = 43₈
35₁₀ = 3*16⁰ + 2*16¹ = 23₁₆