求分母为40的所有真分数
流程图:
伪代码:
源代码:
#include<iostream>
using namespace std;
int main(){
int i,j,num1,num2,t,n=0;
for(i=1;i<40;i++){
num1=40;
num2=i;
while(num2!=0){
t=num1%num2;
num1=num2;
num2=t;
}
if(num1==1){
n++;
cout<<i<<"/40 ";
if(n%8==0){
cout<<endl;
}
}
}
return 0;
}
标签:cout,num2,int,c++,35,打卡,num1 From: https://www.cnblogs.com/HD-Kudu-2219/p/17416184.html