Commit 84ce13ab authored by Michael's avatar Michael

michael.davityan:exercise_05_23v8

parent f2088732
progname=exercise_05_23
CC=g++
CFLAGS=-Wall -Wextra -Werror -g3
all: test1
debug/$(progname): debug/$(progname).o
$(CC) $(CFLAGS) $< -o $@
debug/%.o: debug/%.s
$(CC) -c $(CFLAGS) $< -o $@
debug/%.s: debug/%.ii
$(CC) -S $(CFLAGS) $< -o $@
debug/%.ii: %.cpp | debug
$(CC) -E $(CFLAGS) $< -o $@
debug:
mkdir -p debug
clean:
rm -r debug Tests/*.out
test%: debug/$(progname)
@./debug/$(progname) < Tests/$@.in > Tests/$@.out 2>&1 || echo "$@ is executing..."
@diff Tests/$@.out Tests/$@.expected && echo PASSED || echo FAILED
.PRECIOUS: debug/%.ii debug/%.s
.SECONDARY: debug/%.ii debug/%.s
*
***
*****
*******
*********
*******
*****
***
*
#include <iostream>
#include <cmath>
int
main()
{
for (int row = 4; row >= -4; --row) {
for (int column = -4; column <= 5 - std::abs(row); ++column) {
std::cout << (column <= std::abs(row) - 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