Commit 6df426fb by Artak Yenokyan

Merge branch 'exe_04_17' into 'master'

Exercise_04_17,Version1 See merge request bpcarm/trainings2017!1144
parents 9daac871 9e1f2e35
exercise_04_17: exercise_04_17.o | .gitignore
g++ $^ -o $@
exercise_04_17.ii: exercise_04_17.cpp
g++ -E $^ -o $@
exercise_04_17.s: exercise_04_17.ii
g++ -S $^ -o $@
exercise_04_17.o: exercise_04_17.s
g++ -c $^ -o $@
.gitignore:
echo "exercise_04_17" > $@
clean:
rm *.ii *.s *.o *.out exercise_04_17 .gitignore
test: exercise_04_17
@./exercise_04_17 < test.in > test.out
@diff test.out test.expected > /dev/null 2>&1 && echo PASSED || echo FAILED
test1: exercise_04_17
@./exercise_04_17 < test1.in > test1.out
@diff test1.out test1.expected > /dev/null 2>&1 && echo PASSED || echo FAILED
.PRECIOUS: exercise_04_17.ii exercise_04_17.s
.SECONDARY: exercise_04_17.ii exercise_04_17.s
#include <iostream>
#include <climits>
int
main()
{
int counter = 1;
std::cout << "Enter 10 numbers: ";
double largest = INT_MIN;
while (counter <= 10) {
double number;
std::cin >> number;
if (number > largest) {
largest = number;
}
++counter;
}
std::cout << "The largest value is: " << largest << std::endl;
return 0;
}
Enter 10 numbers: The largest value is: 19999
100
20
33
44
55
10000
19999
777
666
33
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