Kalkulacka  1.0.0
Jednoduchýkalkulátor
filegen.cpp
Zobrazit dokumentaci tohoto souboru.
1 
10 #include <iostream>
11 #include <cstdio>
12 #include <cstdlib>
13 #include <fstream>
14 
15 int main(int argc, char* argv[]) {
16 
17  if (argc != 3){
18  fprintf(stderr, "Chyba pozadovany 2 argumenty pro spravny prubeh \n "
19  "Prvni = pocet cislic \n Druhy = nazev vysledneho souboru \n");
20  }
21 
22  std::ofstream outfile (argv[2]);
23 
24  //outfile << std::stoi(argv[1]) << std::endl;
25 
30  for (int i = 1; i <= std::stoi(argv[1]) ; i++) {
31 
32  /* int high = std::stoi(argv[1]) + 1;
33  int random = rand() % (high - 1) + 1;
34  outfile << random << std::endl; */
35  outfile << i << std::endl;
36  }
37 
38  outfile.close();
39 
40  return 0;
41 }
int main(int argc, char *argv[])
Definition: filegen.cpp:15