Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- ifstream we;
- ofstream wy;
- string a;
- int x, maksymalna y = 0, srednia;
- int main()
- {
- we.open("liczby.txt");
- wy.open("wyniki 3.46 c.txt");
- while ( getline(we, a))
- {
- int i = atoi(a.c_str());
- if ( i < 11 )
- {
- suma+=i;
- Y++;
- }
- }
- srednia = suma/y;
- cout << srednia;
- we.close();
- wy.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement