Download Game! Currently 74 players and visitors. Last logged in:TuneDarolZagolasMaggara

Beow's Blog >> 67299

Back to blogs index
Posted: 22 Aug 2020 19:43 [ permalink ]
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
float a=3, b=4, c=5;

cout << "Pythagoraan lauseesta on kyse: suorakulmainen kolmio. Kateetit ovat a
ja b. Hypotenuusa on c.
";
cout << "a²+b²=c²
";

cout << "a="; cin >> a;
cout << "b="; cin >> b;

c = a*a + b*b;

cout << "c=" << sqrt(a*a + b*b) << "
";

cout << "a²+b²=c²=" << a << "²" << "+" << b << "²" << "=" << a*a << "+" << b*b
<< "=" << c << "
";

return 0;
}