Skip to content

Commit 4f6ed54

Browse files
committed
feat(codeforces/2067C): Add Main.java
1 parent b5bab1b commit 4f6ed54

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

codeforces/2067C/Main.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public static void main(String[] args) throws java.lang.Exception {
88
int t = cin.nextInt();
99
while (t-- > 0) {
1010
int n = cin.nextInt();
11-
int ans = 0;
1211
String s = Integer.toString(n);
1312
boolean hasSeven = false;
1413
for (int i = 0; i < s.length(); i++) {
@@ -21,9 +20,15 @@ public static void main(String[] args) throws java.lang.Exception {
2120
System.out.println(0);
2221
continue;
2322
}
24-
25-
ans = 1;
26-
System.out.println(1);
23+
int ans = 0;
24+
if (n % 9 == 0) {
25+
System.out.println(1);
26+
} else if ((n + (9 - (n % 9))) % 10 == 7) {
27+
System.out.println(1);
28+
}
29+
else {
30+
System.out.println(1);
31+
}
2732
}
2833
}
2934
}

0 commit comments

Comments
 (0)