Advertisement
aurimas12

Untitled

May 30th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <ctime>
  4. #include <fstream> // norint itraukti rekstinio faila reikia sitos komandos
  5.  
  6. using namespace std;
  7.  
  8. //Funkciju aprasymas
  9. void even(int a );
  10. void randnum();
  11.  
  12.  
  13. //Pagrindinis kodas
  14. int main()
  15. {
  16.     int z, k, skaiciai, didz, banana;
  17.     int arr[100];
  18.     cout << "Irasykite kiek skaiciu norite sugeneruoti: "; cin >> k;
  19.  
  20.     ofstream uzd2;
  21.     uzd2.open ("lab2.txt");
  22.     ifstream rez;
  23.     rez.open ("lab2lyginis.txt");
  24.  
  25.     if (uzd2.fail()){
  26.         cout << "Nerastas failas...\n";
  27.     }
  28.     else {
  29.         srand(time(NULL));
  30.         for(int i=0;i<k;i++){
  31.  
  32.             uzd2 << rand()%10;
  33.             uzd2 << "; ";
  34.         /*    while(!)
  35.  
  36.  
  37.  
  38.                 (banana%2==0){
  39.                     rez >> banana;
  40.                     rez >> ";";
  41.                     z++;*/
  42.                 }
  43.         }
  44.    /* }*/
  45.  
  46.           /*  ifstream uzd2;
  47.             uzd2 >> banana;*/
  48.     return 0;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement