Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1.  
  2. char znak[16];
  3.  
  4. /* #1 */
  5. for (int i=0; i < 16; i++)
  6. {
  7. znak[i] = rand()%26 + 65;
  8. if (znak[i] > 90 || znak[i] < 65) {znak[i] ='g'; }
  9. }
  10.  
  11. cout << znak << endl;
  12. strcat(znak,".txt");
  13. ofstream outFile(znak);
  14. cout << znak << endl;
  15.  
  16.  
  17. /* #2 */
  18. if (counter >= 10)
  19. {
  20. outFile.close();
  21.  
  22. for (int i = 0; i < 16; i++)
  23. {
  24. znak[i] = rand()%24 + 65;
  25. if (znak[i] > 90 || znak[i] < 65) {znak[i] ='g'; }
  26. }
  27. // cout << znak << endl;
  28.  
  29. strcat(znak,".txt");
  30.  
  31. ofstream outFile(znak);
  32.  
  33. counter = 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement