1) #include <iostream> #include <conio.h> #include <string> using namespace std; int main() { string str; getline(cin, str); for (int i = 1; i < str.length(); i++) { if (i % 3 == 0) {cout << str[i] << endl;} } _getch(); return 0; } 2) #include <iostream> #include <conio.h> #include <string> using namespace std; int main() { string str; getline(cin, str); for (int i = 1; i < str.length(); i++) { if (i % 2 == 0) { if (str[i] != 'a') { str[i] = 'a'; } if (str[i] != 'b') { str[i] = 'b'; } if (str[i] != 'c') { str[i] = 'c'; } } } cout << str << endl; _getch(); return 0;}
Evsevia-a
14.02.2023
Начнем с формул. Площадь треугольника: S = 1/2*a*b*sin C Отсюда: sin C = 2*S/(a*b); cos C = sqrt(1 - sin^2 C) tg C = sin C / cos C; C = atan(tg C) Теорема косинусов: c = sqrt(a^2 + b^2 - 2*a*b*cos C) Площадь: S = c*h/2; отсюда h = 2*S/c Теорема синусов: a/sin A = b/sin B = c/sin C Отсюда: sin A = a/c*sin C; sin B = b/c*sin C cos A = sqrt(1 - sin^2 A); cos B = sqrt(1 - sin^2 B) tg A = sin A/cos A; A = atan(tg A); tg B = sin B/cos B; B = atan(tg B) Периметр: P = a + b + c Теперь записываем в Паскале singam := 2*S/(a*b); cosgam = sqrt(1 - singam*singam); tangam := singam/cosgam; Gamma := atan(tangam); c := sqrt(a*a + b*b - 2*a*b*cosgam); h := 2*S/c; P := a + b + c; sinalp = a/c*singam; cosalp = sqrt(1 - sinalp*sinalp); tanalp := sinalp/cosalp; Alpha := atan(tanalp); sinbet = b/c*singam; cosbet = sqrt(1 - sinbet*sinbet); tanbet := sinbet/cosbet; Beta := atan(tanbet);
4 Кб = 4 * 2^10 байт = 4 * 1024 = 4098 байт