[ create a new paste ] login | about

Link: http://codepad.org/WvsozpIA    [ raw code | output | fork ]

C++, pasted on Aug 1:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;

double s(double a, double h){
    return a * h / 2;
}

int main(void){
    double a, h;;
    cout << "底辺:";
    cin >> a;
    cout << "高さ:";
    cin >> h;
    cout << "三角形の面積:" << s(a, h) << endl;
    return 0;
}


Output:
1
底辺:高さ:三角形の面積:0


Create a new paste based on this one


Comments: