@@ -3,10 +3,9 @@
using namespace std;
int main() {
- int x, y, z;
- for (x = 0; x < 20; x++)
- for (y = 1; y < 33; y++) {
- z = 100 - x - y;
+ for (int x = 0; 5 * x <= 100; x++)
+ for (int y = 1; 3 * y <= 100; y++) {
+ int z = 100 - x - y;
if (5 * x + 3 * y + z / 3 == 100 && z % 3 == 0) {
cout << "cock=" << x << ",hen=" << y << ",chicken=" << z << endl;
}
@@ -4,7 +4,7 @@ using namespace std;
for (double x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;) {
- cout << setiosflags(ios::fixed) << setprecision(2)
+ cout << fixed << setprecision(2)
<< hypot(x1 - x2, y1 - y2) << endl;
return 0;
@@ -5,7 +5,7 @@ const double pi = atan(1.0) * 4;
for (double r; cin >> r;) {
- cout << setiosflags(ios::fixed) << setprecision(3)
+ cout << fixed << setprecision(3)
<< 4.0 * pi * pow(r, 3) / 3 << endl;
@@ -1,13 +1,13 @@
#include <bit/stdc++.h>
+const double PI = atan(1.0) * 4;
- const double PI = atan(1.0) * 4;
int n;
double r;
for (cin >> n; cin >> r, n--;) {
- cout << setiosflags(ios::fixed) << setprecision(6) << PI * r * r << endl;
+ cout << fixed << setprecision(6) << PI * r * r << endl;