Var x, h, y, alpha : real; begin write('k = '); read(x); write('h = '); read(h); y := 2; while y < 3 + 1E-9 do begin writeln('y = ', y, ', alpha = ', arccos(y / x) * 180 / pi : 0 : 3); y := y + h; end; end.
Пример работы программы: k = 5 h = 0.1 y = 2, alpha = 66.422 y = 2.1, alpha = 65.165 y = 2.2, alpha = 63.896 y = 2.3, alpha = 62.613 y = 2.4, alpha = 61.315 y = 2.5, alpha = 60.000 y = 2.6, alpha = 58.668 y = 2.7, alpha = 57.316 y = 2.8, alpha = 55.944 y = 2.9, alpha = 54.549 y = 3, alpha = 53.130
begin
write('k = ');
read(x);
write('h = ');
read(h);
y := 2;
while y < 3 + 1E-9 do
begin
writeln('y = ', y, ', alpha = ', arccos(y / x) * 180 / pi : 0 : 3);
y := y + h;
end;
end.
Пример работы программы:
k = 5
h = 0.1
y = 2, alpha = 66.422
y = 2.1, alpha = 65.165
y = 2.2, alpha = 63.896
y = 2.3, alpha = 62.613
y = 2.4, alpha = 61.315
y = 2.5, alpha = 60.000
y = 2.6, alpha = 58.668
y = 2.7, alpha = 57.316
y = 2.8, alpha = 55.944
y = 2.9, alpha = 54.549
y = 3, alpha = 53.130
#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;
string dig(int n)
{
string st="";
if (n>9) { st=st+char(n%10+48); st=char(n/10+48)+st; }
else st=st+'0'+char(n+48);
return(st);
}
int main(int argc, char** argv) {
int n,k,m,sc;
string s="";
cout<<"n = "; cin>>n; cout<<endl;
k=n/3600;
m=(n-k*3600)/60;
sc=n-k*3600-m*60;
if (k>24) k=k%24;
if (k<10) s=s+char(k+48)+':';
else s=s+dig(k)+':';
s=s+dig(m)+':';
s=s+dig(sc);
cout<<"time: "<<s<<endl;
system("pause");
return(0);
}