1044:判断是否为两位数

版权声明:请勿盗用 https://blog.csdn.net/ice___snow/article/details/82804236

时间限制: 1000 ms 内存限制: 65536 KB
提交数: 9434 通过数: 6935

【题目描述】

判断一个正整数是否是两位数(即大于等于10且小于等于99)。若该正整数是两位数,输出1,否则输出0。

【输入】

一个正整数,不超过1000。

【输出】

一行。若该正整数是两位数,输出1,否则输出0。

【输入样例】

54

【输出样例】

1

【来源】

No

【代码】

#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n>=10&&n<=99)
	{
		cout<<1<<endl;
	}
	else
	{
		cout<<0<<endl;
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/ice___snow/article/details/82804236