Official
B - Round Down Editorial by en_translator
It can be processed as follows.
- Receive \(X\) as a string
- If \(X\) contains a decimal point, output the string before that
- If \(X\) does not contain a decimal point, output \(X\) as it is
Sample Code (C)
#include <stdio.h>
#include <string.h>
int main() {
char x[203];
scanf("%s", x);
char *dot_pos = strchr(x, '.');
if (dot_pos) *dot_pos = '\0';
puts(x);
return 0;
}
Sample Code (Python)
x = input()
dot_pos = x.find('.')
if dot_pos != -1 : x = x[:dot_pos]
print(x)
posted:
last update: