3 条题解
-
1Prettygirl (12312王诺怡) LV 8 @ 2021-11-27 12:51:46
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a/b<<".";
int y=a%b;
while(1)
{
a=a*10;
cout<<a/b;
a=a%b;
if(a==y||a==0)break;}
if(a==y)
cout<<"Yes";
if(a==0)
cout<<"No";
return 0;
} -
02024-06-26 14:43:20@
#include<iostream> using namespace std; int main(){ ios::sync_with_stdio(false); int a, b; cin >> a >> b; cout << a/b << "."; int x = a % b; while(true){ a *= 10; cout << a/b; a %= b; if(a == x){ cout << "Yes"; break; } if(a == 0){ cout << "No"; break; } } return 0; }
-
-42021-12-01 22:07:19@
#include<iostream>
#include<cmath>
#include<iomanip>
#include<ctime>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a/b<<".";
int x=a%b;
while(1)//永循环
{
a=a*10;
cout<<a/b;
a=a%b;
if(a==x||a==0)break;//跳出循环,判断是否循环
}
if(a==x)
cout<<"Yes";
else if(a==0)
cout<<"No";
return 0;
}
//截图作业一模一样
- 1
信息
- ID
- 1031
- 难度
- 3
- 分类
- (无)
- 标签
- 递交数
- 171
- 已通过
- 81
- 通过率
- 47%
- 上传者