Algoritm:
#include <iostream>
using namespace std;
int main() {
int x,y,z;
double medie;
cin >> x >> y >> z; // citim numerele
medie = (x + y + z) / 3.0; // calculam media
cout << medie << endl; // afisam media
return 0;
}
Pseudocod:
START
x, y, z int
medie double
citeste x, y, z
medie <-- (x + y + z) / 3.0
afiseaza medie
STOP