首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
mlx
2026年3月6日 21:37
判断是否是整数 题解:
P1031
回复 0
|
赞 1
|
浏览 48
#include<iostream> using namespace std; int a; double b; double eps=1e-8; int main() { double x; while(cin>>x) { a=x; b=x-a; if(b>eps) puts("No"); else puts("Yes"); } return 0; }
曾不会
2026年1月29日 16:20
判断是否是整数 题解:
P1031
回复 0
|
赞 1
|
浏览 187
#include<stdio.h> int main() { double a; while(scanf("%lf",&a)!=EOF) { int b=(int(a)); if(a==b) { ...
zxjrheaven
2025年3月15日 11:28
判断是否是整数 题解:暴力
P1031
回复 0
|
赞 4
|
浏览 1.3k
#include <bits/stdc++.h> using namespace std; int main() { double a; while(cin>>a) { long long b=a; if(a-b==0)cout<<"Yes"<&...
GENARDING
2025年3月14日 13:09
还是那句话,计试能ac就行
P1031
回复 0
|
赞 1
|
浏览 980
#include <bits/stdc++.h> using namespace std; int main() { string s; while(cin>>s){ int count=0; for(int i=0;i<s.length();i++){ if(s[i]=='.'){ for(int j=1;j<s.length();j++) { if(s[j]=='0'){ count=0; }else{ count...
Candour
2024年5月24日 18:34
判断是否是整数(C++)题解:
P1031
回复 0
|
赞 3
|
浏览 1.6k
#include<bits/stdc++.h> using namespace std; double n; int main() { while(cin >> n) { if(n - (int)n == 0) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }
RingoCrystal
2024年4月6日 13:15
判断是否是整数 题解:3.000算整数
P1031
回复 0
|
赞 2
|
浏览 1.8k
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int flag=0; int tag=0; for(int i=0;i<s.size();i++){ if(s[i]=='.'){ flag=1; tag=i; break; } } if(tag!=0){ int flag2=0; for(int i=tag+1;i<s.si...
carrot_huan
2024年3月18日 15:15
判断是否是整数 题解:两个开关
P1031
回复 0
|
赞 1
|
浏览 1.2k
#include<bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { bool flag = false; bool flag2 = false; &...
huanghu
2024年3月15日 12:17
判断是否是整数 题解:c++暴力
P1031
回复 0
|
赞 0
|
浏览 1.1k
#include<stdio.h> #include<iostream> #include<string> using namespace std; int main(){ string str; while(cin>>str){ int len = str.length(); bool flag = true; for(int i = 0; i<len; i++){ if(str[i] == '.' &&...
活着的传奇
2023年8月22日 11:05
判断是否是整数 题解:
P1031
回复 0
|
赞 4
|
浏览 1.8k
用判断是不是等于强制转换就可以了 #include<bits/stdc++.h> using namespace std; int main(){ float a; while(scanf("%f",&a)!=EOF){ if(a==(int)a) printf("Yes\n"); else printf("No\n"); } return 0; }
Hegel
2023年3月24日 14:21
判断是否为整数
P1031
回复 0
|
赞 2
|
浏览 2.8k
#include <iostream> #include <string> using namespace std; int main() { string s; while (getline(cin, s)) { int flag = 0; for (int i = 0, f = 0; i < s.size(); i++) { if (s[i] == '.') { f = 1; continue; } if (f == 1 && s[i] != '0') { ...
1
2
题目
判断是否是整数
题解数量
19
发布题解
在线答疑
热门题解
1
c-类型转换
2
判断是否为整数
3
判断是否是整数 题解:
4
判断是否是整数 题解:暴力
5
判断是否是整数(C++)题解:
6
判断是否是整数 题解:3.000算整数
7
判断是否为整数
8
1031判断是否为整数
9
题解:判断是否是整数
10
判断是否是整数(c++)