Commit 64667e36 authored by mary.zaqaryan's avatar mary.zaqaryan

Mary Zaqaryan Exercise_05_07 Version1

parent b21ea84b
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int x;
int y;
cout << "Enter two integers in the range 1-20: ";
cin >> x >> y; // read values for x and y
cout << endl;
for (int i = 1; i <= y; i++) { // count from 1 to y
for ( int j = 1; j <= x; j++ ) {// count from 1 to x
cout << '@'; // output @
}
cout << endl; // begin new line}
}// end outer for
return 0; // indicate successful termination
}
The program asks us to input 2 numbers and uses them like rows and columns. program prints y lines with x columns the simbol "@".
exercise_05_07: exercise_05_07.o | .gitignore
g++ $^ -o $@
exercise_05_07.ii: exercise_05_07.cpp
g++ -E $^ -o $@
exercise_05_07.s: exercise_05_07.ii
g++ -S $^ -o $@
exercise_05_07.o: exercise_05_07.s
g++ -c $^ -o $@
.gitignore:
echo "exercise_05_07" > $@
removes:
rm *.ii *.s *.o *.out exercise_05_07 .gitignore
test: exercise_05_07
./exercise_05_07 < test.in > test.out
diff test.out test.expected > /dev/null 2>&1 && echo PASSED || echo FAILED
Enter two integers in the range 1-20:
@@@@
@@@@
@@@@
@@@@
@@@@
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