Not a member of Pastebin yet?
                        Sign Up,
                        it unlocks many cool features!                    
                - #include <iostream>
 - #include <vector>
 - #include <ctime>
 - #include <fstream>
 - using namespace std;
 - int func(vector<int> v);
 - int main()
 - {
 - srand(time(0)); vector<int> v;
 - for (int i(0); i < 1090; i++)
 - v.push_back(rand() % 2909);
 - int temp = func(v); // rac sheexeba funqciaze parametris gadacemas shegidzlia reference ti gadasce ar aris problema )))
 - ofstream fout("num.out");
 - fout << temp;
 - system("pause");
 - return 0;
 - }
 - int func(vector<int> v)
 - {
 - int sum(0);
 - for (int i(0); i < v.size(); i++)
 - if (v[i] > 99 && v[i] < 10000) sum++;
 - return sum;
 - }
 
Advertisement
 
                    Add Comment                
                
                        Please, Sign In to add comment