#include <iostream>
using namespace std;
int main()
{
double x;
int T = 10;
int c;
double deltaT[7];
for (int c = 0; c < 7; c++)
{
x = rand() % 1 + (0.01 * (rand() % 101));
deltaT[c] = T - x;
}
for (int c = 0; c < 6; c++)
{
if (deltaT[c] > deltaT[c+1]) {
x = deltaT[c];
deltaT[c] = deltaT[c + 1];
deltaT[c + 1] = x;
}
}
for (int c = 0; c < 7; c++) {
cout << deltaT[c] << endl;
}
system("pause");
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpCnsKCWRvdWJsZSB4OwoJaW50IFQgPSAxMDsKCWludCBjOwoJZG91YmxlIGRlbHRhVFs3XTsKCWZvciAoaW50IGMgPSAwOyBjIDwgNzsgYysrKQoJewoJCXggPSByYW5kKCkgJSAxICsgKDAuMDEgKiAocmFuZCgpICUgMTAxKSk7CgkJZGVsdGFUW2NdID0gVCAtIHg7Cgl9CgoJCWZvciAoaW50IGMgPSAwOyBjIDwgNjsgYysrKQoJCXsKCQkJaWYgKGRlbHRhVFtjXSA+IGRlbHRhVFtjKzFdKSB7CgkJCQl4ID0gZGVsdGFUW2NdOwoJCQkJZGVsdGFUW2NdID0gZGVsdGFUW2MgKyAxXTsKCQkJCWRlbHRhVFtjICsgMV0gPSB4OwoJCQl9CgkJfQoJCgkJZm9yIChpbnQgYyA9IDA7IGMgPCA3OyBjKyspIHsKCQljb3V0IDw8IGRlbHRhVFtjXSA8PCBlbmRsOwoJfQoKCXN5c3RlbSgicGF1c2UiKTsKCXJldHVybiAwOwp9