Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- void Dick()
- {
- float a, b, c;
- printf("introduce a: ");
- scanf("%f", &a);
- printf("introduce b: ");
- scanf("%f", &b);
- printf("introduce c: ");
- scanf("%f", &c);
- if (b == 0 && c == 0){
- printf("the solution is 0 biatch");
- } else {
- if (a==0) {
- printf ("matherror");
- } else {
- float indadick = b*b - 4*a*c;
- if (indadick < 0) {
- printf("SI");
- } else {
- printf("SCD\n");
- float indapussy = sqrtf(indadick);
- float indaass_1 = -b + indapussy;
- float indaass_2 = -b - indapussy;
- float indaass_solution_1 = indaass_1 / (2.0f*a);
- float indaass_solution_2 = indaass_2 / (2.0f*a);
- if (indaass_solution_1 == indaass_solution_2){
- printf ("only one solution : %f" , indaass_solution_1);
- } else {
- printf ("solution 1: %f\nsolution 2: %f", indaass_solution_1, indaass_solution_2);
- }
- }
- }
- }
- }
- int main()
- {
- Dick();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement