Commit 00b882c2 by Artak Yenokyan

Merge branch 'exercise_04_25' into 'master'

Mikayel Ghaziyan e4.25 Version 1 See merge request bpcarm/trainings2017!1203
parents 1cf02b42 cb3e168d
#include <iostream>
int
main()
{
int length;
std::cin >> length;
int i = 1;
while (length >= i) {
int j = 1;
while (length >= j) {
if (1 == i) {
std::cout << "*";
} else if (length == i) {
std::cout << "*";
} else if (1 == j) {
std::cout << "*";
} else if (length == j) {
std::cout << "*";
} else {
std::cout << " ";
}
++j;
}
std::cout << std::endl;
++i;
}
return 0;
}
exercise_04_25: exercise_04_25.o | .gitignore
g++ $^ -o $@
exercise_04_25.ii: exercise_04_25.cpp
g++ -E $^ -o $@
exercise_04_25.s: exercise_04_25.ii
g++ -S $^ -o $@
exercise_04_25.o: exercise_04_25.s
g++ -c $^ -o $@
.gitignore:
echo "exercise_04-25" > $@
clean:
rm *.ii *.s *.o *.out exercise_04_25 .gitignore
test1: exercise_04_25
./exercise_04_25 < test1.in > test1.out && echo "Test 1 is executing..."
diff test1.out test1.expected && echo PASSED || echo FAILED
.PRECIOUS: exercise_04_25.ii exercise_04_25.s
.SECONDARY: exercise_04_25.ii exercise_04_25.s
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