博客
关于我
Problem 1008 年龄范围
阅读量:798 次
发布时间:2023-04-02

本文共 466 字,大约阅读时间需要 1 分钟。

Description

编写程序:输入一个整数代表年龄,如果年龄在0至150之间(包括0和150),则打印输出"Yes";如果输入的年龄不在0至150之间,则要求输出"Exception"。

Input

有多组测试数据,每组数据为单独的一行,一个整数N(-1000 ≤ N ≤ 10000)表示所给的年龄。

Output

如果所给年龄在0-150之间输出"Yes",否则输出"Exception"。

Sample Input

0

120

150

-150

Sample Output

Yes

Yes

Yes

Exception

#include     #include     int main(){      int n;      while(scanf("%d",&n)!=EOF){        if(n>=0 && n<=150){          printf("Yes\n");        }else{          printf("Exception\n");        }      }    }

转载地址:http://oxefk.baihongyu.com/

你可能感兴趣的文章