Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- vector<int> nums,iat,rn_st,st,at;
- int get_iat (int n) {
- if (n >= 875) return 9;
- if (n > 750) return 7;
- if (n > 625) return 6;
- if (n > 500) return 5;
- if (n > 375) return 4;
- if (n > 250) return 3;
- if (n > 125) return 2;
- return 1;
- }
- int get_st (int n) {
- if (n > 95) return 6;
- if (n > 85) return 5;
- if (n > 60) return 4;
- if (n > 30) return 3;
- if (n > 10) return 2;
- return 1;
- }
- int main () {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- nums.push_back(0);
- for (int i = 0; i < 3; ++i) {
- nums.push_back(rand() % 1000 + 1);
- }
- iat.push_back(0);
- for (int i = 1; i < (int) nums.size(); ++i) {
- iat.push_back(get_iat(nums[i]));
- }
- for (int i = 0; i < 5; ++i) {
- rn_st.push_back(rand() % 1000 + 1);
- }
- st.push_back(0);
- for (int i = 0; i < 5; ++i) {
- st.push_back(get_st(rn_st[i]));
- }
- at.push_back(0);
- for (int i = 1; i < 5; ++i) {
- at.push_back(at.back() + iat[i]);
- }
- cout << "SN RN IAT AT RN_ST ST\n";
- for (int i = 0; i < 5; ++i) {
- cout << i << " | " << nums[i] << " | " << iat[i] << " | " << at[i] << " | " << rn_st[i] << " | " << st[i] << '\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement