Commit 57a738d6 authored by Karine's avatar Karine

Exercise_06_23, Version2

parent d08a05c3
#include <iostream>
#include <cassert>
void
SquareOfAsterisks(int x)
squareOfAsterisks(int side)
{
for (int i = 1; i <= x; ++i) {
for(int j = 1; j <= x; ++j) {
std::cout <<'*';
assert(side > 0);
for (int i = 1; i <= side; ++i) {
for (int j = 1; j <= side; ++j) {
std::cout << '*';
}
std::cout << std::endl;
......@@ -18,12 +19,12 @@ main()
int size;
std::cout << "Enter the size of a square: ";
std::cin >> size;
std::cout <<std::endl;
std::cout << std::endl;
if (size <= 0) {
std::cerr << "Error 1: Non positive size." << std::endl;
return 1;
}
SquareOfAsterisks(size);
squareOfAsterisks(size);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment