2023年5月18日
摘要: 4.6多项式之和 流程图 代码实现 #include<bits/stdc++.h>using namespace std;const int MOD=1e9+7;int gcd(int a,int b){ return b?gcd(b,a%b):a;} void solve(){int i,n,j; 阅读全文
posted @ 2023-05-18 12:16 临江柔 阅读(12) 评论(0) 推荐(0) 编辑
  2023年5月17日
摘要: 对于正解我觉得代码有些长,不是很简洁; 我的思路是找出分子与40的最大公约数,然后同时除以2最大公约数; #include<bits/stdc++.h>using namespace std;const int MOD=1e9+7;int gcd(int a,int b){ return b?gcd 阅读全文
posted @ 2023-05-17 09:27 临江柔 阅读(12) 评论(0) 推荐(0) 编辑
  2023年5月16日
摘要: 4.4将真分数变为埃及分数 算法流程图 #include<bits/stdc++.h>using namespace std;const int MOD=1e9+7; void solve(){ long long a,b,c; cin>>a>>b; while(1) { if(b%a)c=b/a+ 阅读全文
posted @ 2023-05-16 15:02 临江柔 阅读(6) 评论(0) 推荐(0) 编辑
  2023年5月15日
摘要: 4.3歌星大奖赛 这个程序太简单了;直接输入完数据,然后对数据排序,删除最大最小值即可; #include<bits/stdc++.h>using namespace std;const int MOD=1e9+7; void solve(){ vector<int>a(10); for(int i 阅读全文
posted @ 2023-05-15 09:45 临江柔 阅读(9) 评论(0) 推荐(0) 编辑
  2023年5月14日
摘要: 4.2最大公倍数 #include<bits/stdc++.h>using namespace std; void solve(){ int m,n,temp,b,low,k; cin>>m>>n; k=m*n; if(m<n)swap(m,n); b=m%n; while(b){ m=n;n=b; 阅读全文
posted @ 2023-05-14 21:33 临江柔 阅读(9) 评论(0) 推荐(0) 编辑
  2023年5月12日
摘要: 4.1最大公约数 #include<bits/stdc++.h>using namespace std;int gcd(int a,int b)//求a和b的最大公约数 { return b?gcd(b,a%b):a; //辗转相除法递归形式 } int main(){ int a,b;cin>>a 阅读全文
posted @ 2023-05-12 11:18 临江柔 阅读(2) 评论(0) 推荐(0) 编辑
  2023年5月11日
摘要: 3.10不重复的三位数 直接三重循环,然后判断三位数是否相同,就可以了; #include<bits/stdc++.h>using namespace std;typedef long long ll;void solve(){ for(int i=1;i<5;i++) { for(int j=1; 阅读全文
posted @ 2023-05-11 15:32 临江柔 阅读(9) 评论(0) 推荐(0) 编辑
  2023年5月10日
摘要: 3.9勾股数 数据范围特别小,直接三重循环就可以了; 为了避免重复,在第二重循环时候,用j=i+1; #include<bits/stdc++.h>using namespace std; int main(){ for(int i=1;i<=100;i++) { for(int j=i+1;j<= 阅读全文
posted @ 2023-05-10 12:10 临江柔 阅读(9) 评论(0) 推荐(1) 编辑
  2023年5月9日
摘要: 3.8黑洞数 思路很简单,就把每个数存一下,排序,分别从大到小和从小到大算出来就可以了; #include<bits/stdc++.h>using namespace std; int maxo(int a,int b,int c){ int m,mid,i; m=max(a,max(b,c)); 阅读全文
posted @ 2023-05-09 11:07 临江柔 阅读(15) 评论(0) 推荐(0) 编辑
  2023年5月8日
摘要: 3.7高次方的尾数 根据乘法的规律可以看出来:乘积的后三位仅仅和乘数和被乘数的后三位有关; 所以只看最后三位即可; #include<bits/stdc++.h>using namespace std; int main(){ int ans=1; int x,y;cin>>x>>y; for(in 阅读全文
posted @ 2023-05-08 09:47 临江柔 阅读(6) 评论(0) 推荐(0) 编辑