Advertisement
Guest User

Untitled

a guest
Jul 15th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <ctime>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. void getSign()
  7. {
  8. int x = rand()%20;
  9. if (x > 9) cout << "*";
  10. else cout << x;
  11. }
  12.  
  13. int main(int argc, char *argv)
  14. {
  15. srand(argv[0]);
  16. int cyfry[10] = {0,1,2,3,4,5,6,7,8,9};
  17. random_shuffle(cyfry,cyfry+10);
  18. int c = rand()%10+1;
  19. cout << c << "\n";
  20. while (c--) cout << cyfry[c] << " ";
  21. int t = rand()%200 + 1;
  22. cout << "\n"<<t<<"\n";
  23. while (t--)
  24. {
  25. cout << rand()%9+1;
  26. int n = rand()%1000+1;
  27. while(n--) getSign();
  28. cout << "\n";
  29. }
  30. return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement