Commit 7c1f1dd9 authored by Believer Programmers' Club's avatar Believer Programmers' Club

Merge branch 'ex2.28' into 'master'

Hayk Sargsyan Exercise 2.28. First commit

See merge request bpcarm/trainings2017!291
parents 02ae4f24 a6f72c81
#include <iostream>
int
main()
{
int number;
std::cout << "Enter 5 digit number: ";
std::cin >> number;
if (number / 100000 != 0) {
std::cout << "Error 1: Your given number is not 5 digit number.\n";
return 1;
}
std::cout << number / 10000 % 10 << " "
<< number / 1000 % 10 << " "
<< number / 100 % 10 << " "
<< number / 10 % 10 << " "
<< number % 10 << "\n";
return 0;
}
prog:
g++ -E exercise_02_28.cpp -o exercise_02_28.ii
g++ -S exercise_02_28.ii -o exercise_02_28.s
g++ -c exercise_02_28.s -o exercise_02_28.o
g++ exercise_02_28.o -o exercise_02_28
echo exercise_02_28 > .gitignore
clean:
rm -f exercise_02_28.ii exercise_02_28.s exercise_02_28.o exercise_02_28 .gitignore
test:
./exercise_02_28
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