摘要: #include<bits/stdc++.h>using namespace std;int main(){ for(int a=123,b,c;a<=329;a++) { b=2*a;c=3*a; if((a%10)*(a/10%10)*(a/100)*(b%10)*(b/10%10)*(b/10 阅读全文
posted @ 2022-08-14 10:30 zjtofficial 阅读(31) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;int main(){ double a,b,c,d,x1,x2,x3; scanf("%lf%lf%lf%lf",&a,&b,&c,&d); for(double i=-100;i<=100;i+=0.001)/ 阅读全文
posted @ 2022-08-14 10:26 zjtofficial 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h>using namespace std;struct node{ int xi,s,w;}a[1000001],x[1000001],y[1000001];int n,r,q;bool cmp(node x,node y){ if(x.s!=y.s) r 阅读全文
posted @ 2022-08-13 17:33 zjtofficial 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1.按照笔试成绩从高到低输出,2.如果成绩相同,按报名号由小到大的顺序输出。如果最后到达分数线的大于预订人数,我们就要扩展人数。 #include<iostream>#include<cstdio>#include<algorithm>#include<cmath>using namespace s 阅读全文
posted @ 2022-08-13 15:51 zjtofficial 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 先排序(sort),在计算每个数字出现的次数,用for,一边遍历,一边输出。 #include<bits/stdc++.h>using namespace std;int aa[1000000],a[1000000],n,i,j,ll,rr,bj;void fz(int l,int r){//归并排 阅读全文
posted @ 2022-08-13 15:36 zjtofficial 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 题目要求去重+排序,而且每个数最大不超过1000,所以我们就可以直接使用桶排。由于要先输出个数,再输出每个数 #include<bits/stdc++.h>using namespace std;int m,n,a[2000];//定义一个桶 int main(){ cin>>n; int x; f 阅读全文
posted @ 2022-08-13 15:29 zjtofficial 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 1.总分高的在前面,2.总分相同,语文成绩高的在前面,3.总分,语文成绩相同,学号小的在前面 #include<cstdio> #include<iostream> #include<algorithm> using namespace std; struct node//定义结构体 { int n 阅读全文
posted @ 2022-08-13 15:20 zjtofficial 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 只要一个一个比,然后找到价格最少的就可以了,可以用需要的铅笔数去和每种包装里铅笔数取模,如果结果为0,说明正好达到需要的数量,那就算出买这种包装铅笔需要的价格;如果结果不等于0,说明需要多买一份(向上取整),取模+1就可以算出需要买几份,最后就可以算出买这种包装铅笔需要的价格。最后再找到最少价钱的那 阅读全文
posted @ 2022-08-13 10:17 zjtofficial 阅读(50) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>int main(){ int k,b=0,i=1; scanf("%d",&k); while(k>i){ b+=i*i; k-=i; i++; } b+=i*k; printf("%d",b); return 0;} 阅读全文
posted @ 2022-08-13 10:15 zjtofficial 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 统计指定数字出现的次数。 #include<iostream>using namespace std; int check(int n){ int f; int i = 0; while (n >= 10) { f = n % 10; n /= 10; if (f == 2) { i++; } } 阅读全文
posted @ 2022-08-13 10:13 zjtofficial 阅读(19) 评论(0) 推荐(0) 编辑