Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //სამკუთხედის ფართობისა და პერიმეტრის ბეჭდვა pair-ების მეშვეობით
- #include <iostream>
- using namespace std;
- pair<double, int> Triangle(const int& side)//ტოლგვერდა სამკუთხედი
- {
- pair<double, int> tr;
- tr.first = 0.25 * side * side * sqrt(3.);//ფართობი
- tr.second = 3 * side;//პერიმეტრი
- return tr;
- }
- int main()
- {
- cout << "Enter side of Triangle: ";
- int side;
- cin >> side;
- pair<double, int> t = Triangle(side);
- cout << "Side of equilateral Triangle is " << side
- << ",\nIt's Area is " << t.first << ", Perimeter is "
- << t.second << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment