решить Сформировать массив множителей заданного числа, большего 10 Даны действительные числа а1, а2, …, аn. Поменять местами первый наименьший элемент с последним наименьшим элементом.
Program ZvonPOBEDITEL;var i,n,k,i_1,i_2,d_1,d_2: integer;c: char;s,s_1,s_2: string;begin i_1:=0; i_2:=0; d_1:=1; d_2:=1; readln(n); for i:=1 to n do begin c:='a'; s:=''; while c<>' ' do begin read(c); s:=s+c; end; read(c); while c<>' ' do begin s:=s+c; read(c); end; read(c); while c<>' ' do begin read(c); end; readln(k); if (k=i_1) and (i<>1) then d_1:=d_1+1; if k>i_1 then begin i_2:=i_1; i_1:=k; s_2:=s_1; s_1:=s; d_2:=d_1; d_1:=1; end; if (k=i_2) and (i<>1) then d_2:=d_2+1; if (k>i_2) and (k<i_1) then begin i_2:=k; s_2:=s; d_2:=1; end; end; if (i_1<=200) and (d_1=1) then writeln(s_1); if (i_1<=200) and (d_1<>1)then writeln(d_1); if (i_1>200) and (d_2=1) then writeln(s_2); if (i_1>200) and (d_2<>1) then writeln (d_2);end. Это сугубо мое решение за копирайтинг отвешу люлей. И к тому же сдесь есть одна ошибка о которой знаю только я, так сказать один из частных случаев здесь не прощитывается, по этому поломайте голову, Ха-Ха-Ха...
#include<iostream>
#include<iomanip>
#define _USE_MATH_DEFINES
#include<cmath>
using namespace std;
int main()
{
double a, b, c, alfa, beta, gamma;
cout <<"a="; cin >> a;
cout <<"b="; cin >> b;
cout <<"c="; cin >> c;
if (a+b>c && a+c>b && b+c>a)
{
alfa = acos((b*b+c*c-a*a)/(2*b*c))*180/M_PI;
beta = acos((a*a+c*c-b*b)/(2*a*c))*180/M_PI;
gamma = acos((a*a+b*b-c*c)/(2*a*b))*180/M_PI;
cout <<"Angles in degrees:\n";
cout <<setprecision(3)<<fixed<< "alfa=" << alfa << " beta=" << beta << " gamma=" << gamma << endl;
}
else cout << "Triangle absent\n";
system("pause");
return 0;
}