Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #define _USE_MATH_DEFINES
- #include "info2_core.h"
- #include "DiagramValues.h"
- #include "plotter.h"
- #include "windows.h"
- #include <string.h>
- #include <stdlib.h>
- #include <iostream>
- #include <math.h>
- #include "time.h"
- extern char acOutput[ciMaxText];
- using namespace Informatik;
- //Prototyp
- double nullstellen (double,double,double);
- //Struktur 1
- struct Extrema{
- double NST1;
- double NST2;
- int ERG;
- };
- //Struktur 2
- struct PolySrc{
- };
- struct PolyDst{
- };
- //Hauptprogramm
- void Info2::Uebungen11(){
- double a=4;
- double b=2;
- double c=-2;
- Extrema ExtremaH ={};
- ExtremaH = nullstellen(ExtremaH);
- nullstellen(a,b,c);
- /*sprintf(acOutput, "%.2f ,%.2f",NS1,NS2);
- WriteText(200,200,acOutput);
- */
- return;
- }
- //Unterprogramme 1
- double nullstellen(double a, double b, double c){
- double NS1=0;
- double NS2=0;
- double D=0;
- int erg=0;
- D=(b*b)-(4*a*c);
- if(D>0 && a!=0){
- NS1=(-b+sqrt(D))/(2*a);
- NS2=(-b-sqrt(D))/(2*a);
- erg=2;
- }
- else if(D==0 && a!=0){
- NS1=-b/(2*a);
- erg=1;
- }
- else if(D<0 && a!=0){
- erg=0;
- }
- else if(a==0 && b!=0 && c!=0){
- NS1=(-c)/b;
- erg=1;
- }
- else erg=0;
- return;
- }
- //Unterprogramm 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement