Advertisement
newb_ie

Untitled

Oct 3rd, 2021
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. vector<int> nums,iat,rn_st,st,at;
  4.  
  5. int get_iat (int n) {
  6. if (n >= 875) return 9;
  7. if (n > 750) return 7;
  8. if (n > 625) return 6;
  9. if (n > 500) return 5;
  10. if (n > 375) return 4;
  11. if (n > 250) return 3;
  12. if (n > 125) return 2;
  13. return 1;
  14. }
  15.  
  16. int get_st (int n) {
  17. if (n > 95) return 6;
  18. if (n > 85) return 5;
  19. if (n > 60) return 4;
  20. if (n > 30) return 3;
  21. if (n > 10) return 2;
  22. return 1;
  23. }
  24.  
  25. int main () {
  26. ios::sync_with_stdio(false);
  27. cin.tie(nullptr);
  28. cout.tie(nullptr);
  29. nums.push_back(0);
  30. for (int i = 0; i < 3; ++i) {
  31. nums.push_back(rand() % 1000 + 1);
  32. }
  33. iat.push_back(0);
  34. for (int i = 1; i < (int) nums.size(); ++i) {
  35. iat.push_back(get_iat(nums[i]));
  36. }
  37. for (int i = 0; i < 5; ++i) {
  38. rn_st.push_back(rand() % 1000 + 1);
  39. }
  40. st.push_back(0);
  41. for (int i = 0; i < 5; ++i) {
  42. st.push_back(get_st(rn_st[i]));
  43. }
  44. at.push_back(0);
  45. for (int i = 1; i < 5; ++i) {
  46. at.push_back(at.back() + iat[i]);
  47. }
  48. cout << "SN RN IAT AT RN_ST ST\n";
  49.  
  50. for (int i = 0; i < 5; ++i) {
  51. cout << i << " | " << nums[i] << " | " << iat[i] << " | " << at[i] << " | " << rn_st[i] << " | " << st[i] << '\n';
  52. }
  53. }
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement