Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <cmath>
- #include <string>
- using namespace std;
- //Task 25
- int solve(int num) {
- int sNum = num;
- int a = num % 10;
- num /= 10;
- int b = num % 10;
- num /= 10;
- int c = num % 10;
- if (a > b && b > c)
- return sNum;
- return 0;
- }
- int main() {
- int res = 0;
- for (int i = 0; i < 5; i++) {
- int num;
- cin >> num;
- res += solve(num);
- }
- cout << res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement