#include <stdio.h>
int width, height, s, area;
void main()
{
printf("This program is to caclulate the area of a triangle.\n");
scanf("%d %d", &width, &height);
s = width * height;
area = s / 2;
printf("Width = %d, Height = %d, Area = %d\n", width, height, area);
scanf("%d %d", &width, &height);
s = width * height;
area = s / 2;
printf("Width = %d, Height = %d, Area = %d\n", width, height, area);
}
'노트 > Flowchart to C 순서도에서 C언어로' 카테고리의 다른 글
두 수의 크기 판별하기 (2) (0) | 2011.03.04 |
---|---|
두 수의 크기 판별하기 (1) (0) | 2011.03.04 |
절대값 구하기 (0) | 2011.03.04 |
양수, 음수 판별하기 (2) (0) | 2011.03.04 |
양수, 음수 판별하기 (1) (0) | 2011.03.04 |
홀수, 짝수 판별하기 (0) | 2011.03.04 |
초 단위의 시간을 시간, 분, 초로 변경하기 (0) | 2011.03.04 |
시간을 초 단위로 변경하기 (0) | 2011.03.04 |
3 과목의 성적에 대한 총점과 평균 구하기 (0) | 2011.03.04 |
사각형의 면적 구하기 (0) | 2011.03.04 |