文章
84
粉丝
408
获赞
33
访问
872.0k
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
while (cin >> s) {
bool flag = true;
bool dot = false;
for (int i = 0; i < s.length(); i++) {
if (s[i] == '.') {
dot = true;
continue;
}
if (dot && s[i] != '0') {
flag = false;
break;
}
if (s[i] < '0' || s[i] > '9') {
flag = false;
break;
}
}
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发