最近看这道题全是题解,赶紧来一篇
[题目传送门](https://www.luogu.com.cn/problem/P5712)
这道题总共分2种情况:x<=1,x>1
先看x<=1
直接输出Today, I ate x apple.
再看x>1
直接输出Today, I ate x apples.
这是我们发现Today, I ate x apple.在每句都有,于是可以先输出Today, I ate x apple.,然后判断x的大小就可以
上代码!
为了显示我很厉害,所以c++代码不给了
上python!
```python
x=int(input())
print("Today, I ate",x,"apple",end='')
if x>1:
print("s",end='')
print(".")
```
提交一下,结果错了,我的天,什么情况
在我~~苦思脑想了1分钟~~之后,突然想起python整数和字符串一起输出时会自动加空格,于是。。。
```python
x=int(input())
print("Today, I ate",x,"apple",end='')
if x>1:
print("s",end='')
print(".")
```
[AC记录](https://www.luogu.com.cn/record/46514295)
看出我改哪了吗?