Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unordered_map>
- #include <vector>
- using namespace std;
- int main()
- {
- vector<char> arr;
- vector<char> arr2;
- char input;
- while (input != '.')
- {
- cin >> input;
- if (input == '.')
- {
- break;
- }
- arr.push_back(input);
- }
- //abab1bca98abab1. size = 15
- int size = arr.size() / 5; // ==3
- int five = arr.size() / size; // == 5
- // cout << size << '\n';
- // cout << five << '\n';
- /*here i want to print every 5th part o the input
- for example from this abab1bca98abab1. i want to print
- abab1
- bca98
- abab1
- */
- for (int i = 0; i < arr.size();)
- {
- for (int j = 0; j < 5;)
- {
- cout << arr[j];
- j++;
- }
- i += 5;
- cout << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement