P5712 【深基3.例4】Apples(分支结构)

题目描述
八尾勇喜欢吃苹果。她今天吃掉了 x(0<=x<=100)个苹果。英语课上学到了 apple 这个词语,想用它来造句。如果她吃了 1 个苹果,就输出 Today, I ate 1 apple.;如果她没有吃,那么就把 1 换成 0;如果她吃了不止一个苹果,别忘了 apple 这个单词后面要加上代表复数的 s。你能帮她完成这个句子吗?

输入格式

输出格式

输入输出样例
输入

1

输出

Today, I ate 1 apple.

输入

3

输出

Today, I ate 3 apples.

注意
apple为复数时加s;

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int main ()

{
    int n;
    scanf("%d",&n);
    if(n>=0&&n<=1)
        printf("Today, I ate %d apple.",n);
    if(n>2)
        printf("Today, I ate %d apples.",n);
}

客官记得一键三连啊!


posted @ 2021-01-05 08:45  S1Lu  阅读(129)  评论(0)    收藏  举报