Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- #include <chrono>
- using namespace std;
- int main() {
- float sequence;
- float chain;
- cout << "Podaj wartość sekwencyjną: ";
- cin >> sequence;
- cout << "Podaj wartość łańcuchową: ";
- cin >> chain;
- string out;
- for (int h = 0; h < chain; ++h) {
- for (int i = 0; i < sequence; ++i) {
- out = "";
- for (int k = 0; k < sequence - i; ++k) {
- out += " ";
- }
- for (int j = -1; j < i * 2; ++j) {
- out += "*";
- }
- this_thread::sleep_for(chrono::milliseconds(7));
- cout << out << endl;
- }
- for (int i = sequence; i > -1; i--) {
- out = "";
- for (int k = 0; k < sequence - i; ++k) {
- out += " ";
- }
- for (int j = -1; j < i * 2; ++j) {
- out += "*";
- }
- this_thread::sleep_for(chrono::milliseconds(7));
- cout << out << endl;
- }
- }
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement