All pastes #420777 Raw Edit

Something

public text v1 · immutable
·published 2007-04-02 11:50 UTC
rendered paste body
// k1.cpp : Defines the entry point for the console application.
// pobiera boki trojkata i oblicza pole wzorem herona

#include "stdafx.h"
#include <math.h>


int _tmain(int argc, _TCHAR* argv[])
{
float a, b, c, p, p2;
	printf("Podaj boki trojkata:\n");
	scanf("%f", &a);
	scanf("%f", &b);
	scanf("%f", &c);
	p = (a + b + c) / 2;
	p2 = p * (p - a) * (p - b) * (p - c);
	printf("\nPole powierzchni wynosi %f\n", sqrt(p2));
}