Commit 67250c51 authored by Karine's avatar Karine

Exercise_06_23, Version4

parent 87e75745
......@@ -2,12 +2,12 @@
#include <cassert>
void
printSquare(int size1, char size2)
printSquare(int size1, char character)
{
assert(size1 > 0);
for (int i = 1; i <= size1; ++i) {
for (int j = 1; j <= size1; ++j) {
std::cout << size2;
std::cout << character;
}
std::cout << std::endl;
......@@ -20,7 +20,6 @@ main()
int size;
std::cout << "Enter the size of a square: ";
std::cin >> size;
std::cout <<std::endl;
if (size <= 0) {
std::cerr << "Error 1: Non positive size." << std::endl;
......@@ -29,7 +28,6 @@ main()
char character;
std::cout << "Enter a character: ";
std::cin >> character;
std::cout << std::endl;
printSquare(size, character);
return 0;
......
Enter the size of a square:
Enter a character:
%%%%%
Enter the size of a square: Enter a character: %%%%%
%%%%%
%%%%%
%%%%%
......
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