Skip to content

Commit

Permalink
Improve input/output
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Nov 6, 2024
1 parent 2215695 commit 41d5bd7
Show file tree
Hide file tree
Showing 6 changed files with 1,286 additions and 20 deletions.
14 changes: 7 additions & 7 deletions solutions/beecrowd/1035/1035.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
int main() {
int16_t a, b, c, d;

scanf("%d %d %d %d", &a, &b, &c, &d);

if (b > c && d > a && c + d > a + b && c > 0 && d > 0 && a % 2 == 0) {
printf("Valores aceitos\n");
} else {
printf("Valores nao aceitos\n");
}
while (scanf("%d %d %d %d", &a, &b, &c, &d) != EOF) {
if (b > c && d > a && c + d > a + b && c > 0 && d > 0 && a % 2 == 0) {
printf("Valores aceitos\n");
} else {
printf("Valores nao aceitos\n");
}
};

return 0;
}
14 changes: 7 additions & 7 deletions solutions/beecrowd/1035/1035.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
int main() {
std::int16_t a, b, c, d;

scanf("%d %d %d %d", &a, &b, &c, &d);

if (b > c && d > a && c + d > a + b && c > 0 && d > 0 && a % 2 == 0) {
printf("Valores aceitos\n");
} else {
printf("Valores nao aceitos\n");
}
while (scanf("%d %d %d %d", &a, &b, &c, &d) != EOF) {
if (b > c && d > a && c + d > a + b && c > 0 && d > 0 && a % 2 == 0) {
printf("Valores aceitos\n");
} else {
printf("Valores nao aceitos\n");
}
};

return 0;
}
13 changes: 8 additions & 5 deletions solutions/beecrowd/1035/1035.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
a, b, c, d = map(int, input().split())
import sys

if b > c and d > a and c + d > a + b and c > 0 and d > 0 and a % 2 == 0:
print('Valores aceitos')
else:
print('Valores nao aceitos')
for line in sys.stdin:
a, b, c, d = map(int, line.split())

if b > c and d > a and c + d > a + b and c > 0 and d > 0 and a % 2 == 0:
print('Valores aceitos')
else:
print('Valores nao aceitos')
15 changes: 15 additions & 0 deletions solutions/beecrowd/1035/generate_in.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

set -euo pipefail

MAX_NUMBER=4

for i in $(seq 0 "${MAX_NUMBER}"); do
for j in $(seq 0 "${MAX_NUMBER}"); do
for k in $(seq 0 "${MAX_NUMBER}"); do
for l in $(seq 0 "${MAX_NUMBER}"); do
echo "${i} ${j} ${k} ${l}"
done
done
done
done
Loading

0 comments on commit 41d5bd7

Please sign in to comment.