Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- short PierwiastkiKwadratowe(double a, double b, double c, double &x1, double &x2)
- {
- short y;
- double delta;
- delta=(b*b)-(4*a*c);
- if(delta<0) y=0;
- if(delta==0)
- {
- x1=(-b)/(2*a);
- y=1;
- }
- if(delta>0)
- {
- x1=(-b-sqrt(delta))/(2*a);
- x2=(-b+sqrt(delta))/(2*a);
- if(x1>x2)
- {
- delta=x1;
- x1=x2;
- x2=delta;
- }
- y=2;
- }
- return y;
- }
- void Fibonacci(int tab[], int n)
- {
- int a=0, b=1;
- if(n>0) tab[0]=a;
- for(int i=1;i<=n;i++)
- {
- tab[i]=b;
- b+=a;
- a=b-a;
- }
- }
- int Licznik(bool x, int &y)
- {
- static int a=0;
- if (x==false) a++;
- if (x==true) y++;
- return a;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement