#include <math.h>
#include <iostream>
#include <iomanip>
#include "round.cpp"
void main ()
{ const float pi = 3.14159;
const char zvezdica = '*'; const int skal_fakt = 20; const int min_kot = 0; const int max_kot = 360; const int korak = 18;
int kot_v_stop; int pozicija; float kot_v_rad; const float rad_na_stop = pi / 180.0; float round
(float, int); cout << " Kot" << setw (45) << "Izris sinusne krivulje " << endl
<< endl;
kot_v_stop = min_kot; while (kot_v_stop <= max_kot)
{
kot_v_rad = kot_v_stop * rad_na_stop;
pozicija = 4 + int (round (skal_fakt * (1.0 + sin (kot_v_rad)), 0));
cout << setw (4) << kot_v_stop << '|';
cout << setw (pozicija + 1) << zvezdica; cout << setiosflags (ios::scientific | ios::showpoint)
<< setprecision (6)
<< setw(20) << sin(kot_v_rad) << endl;
kot_v_stop += korak; }
cout << "---------------------------------------------------------";
return;
}