python3代码:
""" P5712 【深基3.例4】Apples(python3实现) https://www.luogu.com.cn/problem/P5712 """ x=int( input() ) if x==0 or x==1: print("Today, I ate %d apple."%x) else: print("Today, I ate %d apples."%x)
C++代码:
/*
P5712 【深基3.例4】Apples
https://www.luogu.com.cn/problem/P5712
*/
#include <bits/stdc++.h>
using namespace std;
int main( void )
{
int x;
cin>>x;
if (x==0 || x==1)
{
printf("Today, I ate %d apple.",x);
}
else
{
printf("Today, I ate %d apples.",x);
}
return 0;
}
/*
作业:
P5703 【深基2.例5】苹果采购
P5704 【深基2.例6】字母转换
P5705 【深基2.例7】数字反转
*/
Scratch2代码:
scratch3代码: