信息学奥赛C++语言:判断两位数

【题目描述】
从键盘输入一个数,如果是两位数那么输出yes,否则输出no。

【输入】
输入一行,包含1 个整数

【输出】
输出只有一行,yes 或 no。

【输入样例】
Sample Input1
2

Sample Input2
12

【输出样例】
Sample Output1
no

Sample Output2
yes

代码

#include<cstdio>
using namespace std;
int a;
int main()
{
	scanf("%d",&a);
	if(a>9&&a<100){
		printf("yes");
	}
	else{
		printf("no");
	}
   return 0;
 } 

猜你喜欢

转载自blog.csdn.net/zsbailong/article/details/89422526
今日推荐