summaryrefslogtreecommitdiff
path: root/1_anno/Programmazione_2/exercises/minore.cc
blob: 677da76ecefb7c3da1e237214488fbe707755c5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<iostream>
#include<string>
#include<fstream>

using namespace std;

int main() {
    ifstream in("input.txt");
    ofstream out("output.txt");

    for(int ts = 0; ts < 100; ++ts) {
        string s;
        in >> s;
        int minor = stoi(s);
        for(in >> s; s != "STOP"; in >> s) {
            int si = stoi(s);
            if(si < minor)
                minor = si;
        }

        out << minor << '\n';
    }

    in.close();
    out.close();
    return 0;
}