Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <limits.h>
- using namespace std;
- ifstream fin("bac.in");
- int main() {
- int mins[3];
- mins[0] = mins[1] = mins[2] = INT_MAX;
- for (int x; fin >> x;) {
- if (x % 100 == 20) {
- if (x < mins[0]) {
- mins[2] = mins[1];
- mins[1] = mins[0];
- mins[0] = x;
- } else if (x < mins[1]) {
- mins[2] = mins[1];
- mins[1] = x;
- } else if (x < mins[2]) {
- mins[2] = x;
- }
- }
- }
- for (int i = 0; i < 3; i++) {
- cout << mins[i] << ' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement