Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <math.h>
- using namespace std;
- void Prob1() {
- float a, b, c, delta, x1, x2, aux;
- //scanf("%d", a);
- //scanf("%d", b);
- //scanf("%d", c);
- scanf("%f %f %f", &a, &b, &c);
- //printf("%d %d %d", a, b, c);
- aux = 1.0; delta = 0.0;
- aux *= b;
- aux *= b;
- delta += aux;
- aux -= aux;
- aux += 4;
- aux *= a;
- aux *= c;
- delta -= aux;
- aux = sqrt(delta);
- x1 = x2 = aux;
- x1 -= b;
- x2 += b;
- x1 /= 2;
- x1 /= a;
- x2 /= 2;
- x2 /= a;
- printf("x1 = %f \nx2 = %f", x1, x2);
- }
- void Prob2() {
- int a, b, c, mx;
- scanf("%d %d %d", &a, &b, &c);
- mx = (a > b) ? (a) : (b);
- mx = (mx > c) ? (mx) : (c);
- printf("%d", mx);
- }
- void Prob3() {
- int a, b;
- scanf("%d %d", &a, &b);
- printf("%d : %d = %d rest %d", a, b, (a / b), (a % b));
- }
- void Prob4() {
- float xa, ya, xb, yb;
- scanf("%f %f %f %f", &xa, &ya, &xb, &yb);
- float aux1 = (xa - xb) * (xa - xb);
- float aux2 = (ya - yb) * (ya - yb);
- float aux3 = sqrt(aux1 + aux2);
- printf("%f\n", aux3);
- cout << aux3;
- }
- void ProbS() {
- int i, n = 3;
- for(i = 0; i < n; --i)
- cout << '$';
- /// $$$
- }
- int main()
- {
- Prob1();
- //Prob2();
- //Prob3();
- //Prob4();
- //printf("%.2d", sqrt(16.0));
- //ProbS();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement