Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<fstream>
- #include<iomanip>
- using namespace std;
- double v(int a,int b,int c,int d,int e)
- {
- return (a + b + c + d + e) / 5.0;
- }
- int main()
- {
- double vid;
- int a, b, c, d, e;
- ifstream fd("Pazymiai.txt");
- ofstream fr("Vidurkiai.txt");
- for ( int i = 0; i < 5; i++) {
- fd >> a >> b >> c >> d >> e;
- vid = v(a, b, c, d, e);
- fr << fixed << setprecision(2) << vid << endl;
- }
- fd.close();
- fr.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement