Commit 5cef287c authored by Artak Yenokyan's avatar Artak Yenokyan

Merge branch 'exe_23' into 'master'

Exercise_05_23, Version1

See merge request bpcarm/trainings2017!1200
parents 4fa6bc4f 234d14c7
exercise_05_23: main.o | .gitignore
g++ $^ -o $@
main.ii: main.cpp
g++ -E $^ -o $@
main.s: main.ii
g++ -S $^ -o $@
main.o: main.s
g++ -c $^ -o $@
.gitignore:
echo "exercise_05_23" > $@
clean:
rm *.ii *.s *.o *.out exercise_05_23 .gitignore
test: exercise_05_23
@./exercise_05_23 > test.out
@diff test.out test.expected > /dev/null 2>&1 && echo PASSED || echo FAILED
.PRECIOUS: main.ii main.s
.SECONDARY: main.ii main.s
#include <iostream>
#include <cmath>
int
main()
{
for (int i = -4; i <= 4; ++i) {
for (int j = -4; j <= 4; ++j) {
std::cout << ((std::abs(i) + std::abs(j) <= 4) ? "*" : " ");
}
std::cout << std::endl;
}
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