Results 1 to 16 of 16
Thread: ++
Hybrid View
-
8th November 2006 19:45 #1
++
, , . 3 if else, .
if (a>b)
{
if (a>c)
a = A;
}
else if (b>a)
{
if (b>a)
b = A;
}
else (c>a)
{
if (c>b)
c = A;
}
, - . 3 - ...Ad astra per aspera - To the stars through difficulties
Nvidia - The way you are meant to be played!
Blog - http://poseyd0n.blogspot.com/
-
8th November 2006 21:09 #2
int max;
if (a > b)
{
___if (a > c)
___{
______max = a;
___}
___else
___{
______max = c;
___}
}
else
{
___if (b > c)
___{
______max = b;
___}
___else
___{
______mx = c;
___}
}
_, -.
-
8th November 2006 21:20 #3
[bg] [/bg]Code:int max = a; if (b > max) max = b; if (c > max) max = c;
update: :
Code:#include <algorithm> ... int max = std::max(a, std::max(b, c));
, !
-
8th November 2006 21:35 #4
Originally Posted by Psho

Code:max=(b>a)?b:((c>a)?c:a);
ignore list:Java,velio,jaredharet,gochev.george,Nit rogeniumQuis custodiet ipsos custodes?
-
8th November 2006 21:42 #5
-
8th November 2006 21:48 #6, ...
Originally Posted by Pesho
++
Code:max=(b>a)?((c>b)?c:b):((c>a)?c:a);
ignore list:Java,velio,jaredharet,gochev.george,Nit rogeniumQuis custodiet ipsos custodes?
-
9th November 2006 09:45 #7
:
Originally Posted by poseydon
Originally Posted by poseydon
: XaMaB; . 0.42
In God we Trust (all others must submit a X.509 certificate). , ()
-
9th November 2006 11:51 #8
Originally Posted by XaMaB
...
@poseydon ? max(a,b,c) " ...", , , , .. max(a,b,c) , .
, - a,b,c max[3], , , index i (i=1,2, 3) max[i] = A;
.. - <->. , max(a,b,c) , - - a, b c..." , , , , ."
-
10th November 2006 13:14 #9
: , , . - . , ...
- , , , .
:
6, .
, , - . :
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a,b,c; /*Trite strani na triugulnika*/
double S; /*Liceto na triugulnika*/
double K; /*Koeficient K*/
double sin; /*Sinus promenliva*/
cout << "Enter a side of the triangle\n";
cin >> a;
cout << "Enter b side of the triangle\n";
cin >> b;
cout << "Enter c side of the triangle\n";
cin >> c;
double max = a; /*Promenliva za nai-golemia ugul*/
if (b > max) max = b;
if (c > max) max = c;
cout << max;
S = (a + b + c) / 2;
K = sqrt(S* (S-a) * (S-b) * (S-c));
if (max = a) sin = 2*K / (b*c);
if (max = b) sin = 2*K / (a*c);
if (max = c) sin = 2*K / (a*b);
cout << "Sine from the biggest angle is" << sin << "\n";
system("Pause");
return 0;
}
Last edited by poseydon; 10th November 2006 at 13:36.
Ad astra per aspera - To the stars through difficulties
Nvidia - The way you are meant to be played!
Blog - http://poseyd0n.blogspot.com/
-
10th November 2006 13:37 #10
, - Pesho, . max .
. 6 ?ignore list:Java,velio,jaredharet,gochev.george,Nit rogeniumQuis custodiet ipsos custodes?
-
10th November 2006 17:38 #11
-
10th November 2006 17:57 #12. ! S , , " ". , .
"=" , . sin(<ACB). 3,4,5 , 5,3,4 . , :Code:if (max = a) sin = 2*K / (b*c); if (max = b) sin = 2*K / (a*c); if (max = c) sin = 2*K / (a*b);
else...Code:if (max == a) sin = 2*K / (b*c); if (max == b) sin = 2*K / (a*c); if (max == c) sin = 2*K / (a*b);
Fujistu Lifebook E756 | Core i7-6500U / 400MHz-3.1GHz | 8 GB DDR4-2133 | Samsung PM871 / 256 GB SSD | 15" 1920x1080 | Manjaro Linux + kernel 4.19




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in