Guest User

Untitled

a guest
Nov 4th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. #include <vector>
  4. #include <ctime>
  5. #include <fstream>
  6. using namespace std;
  7. int func(vector<int> v);
  8. int main()
  9. {
  10.     srand(time(0)); vector<int> v;
  11.     for (int i(0); i < 1090; i++)
  12.         v.push_back(rand() % 2909);
  13.     int temp = func(v);       // rac sheexeba funqciaze parametris gadacemas shegidzlia reference ti gadasce ar aris problema )))
  14.     ofstream fout("num.out");
  15.     fout << temp;
  16.     system("pause");
  17.     return 0;
  18. }
  19. int func(vector<int> v)
  20. {
  21.     int sum(0);
  22.     for (int i(0); i < v.size(); i++)
  23.     if (v[i] > 99 && v[i] < 10000)  sum++;
  24.     return sum;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment