Commit e2460f6d authored by Artak Yenokyan's avatar Artak Yenokyan

Merge branch 'exercise_04_26' into 'master'

Mikayel Ghaziyan e4.26 Version 1 See merge request bpcarm/trainings2017!1242
parents d5ed7511 007eb24e
#include <iostream>
int
main()
{
int number;
std::cin >> number;
int initialNumber = number; ///To store the initial value
int reverse = 0;
while (number != 0) {
int digit = number % 10;
reverse = (reverse * 10) + digit;
number = number / 10;
}
if (reverse == initialNumber) {
std::cout << "The number is polindrome" << std::endl;
} else {
std::cout << "The number is not polindrome" << std::endl;
}
return 0;
}
exercise_04_26: exercise_04_26.o | .gitignore
g++ $^ -o $@
exercise_04_26.ii: exercise_04_26.cpp
g++ -E $^ -o $@
exercise_04_26.s: exercise_04_26.ii
g++ -S $^ -o $@
exercise_04_26.o: exercise_04_26.s
g++ -c $^ -o $@
.gitignore:
echo "exercise_04-26" > $@
clean:
rm *.ii *.s *.o *.out exercise_04_26 .gitignore
test1: exercise_04_26
./exercise_04_26 < test1.in > test1.out && echo "Test 1 is executing..."
diff test1.out test1.expected && echo PASSED || echo FAILED
.PRECIOUS: exercise_04_26.ii exercise_04_26.s
.SECONDARY: exercise_04_26.ii exercise_04_26.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