摘要:
#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
阅读(132)
评论(0)
推荐(0)
摘要:
1.按照笔试成绩从高到低输出,2.如果成绩相同,按报名号由小到大的顺序输出。如果最后到达分数线的大于预订人数,我们就要扩展人数。 #include<iostream>#include<cstdio>#include<algorithm>#include<cmath>using namespace s 阅读全文
posted @ 2022-08-13 15:51
zjtofficial
阅读(120)
评论(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
阅读(39)
评论(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
阅读(70)
评论(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
阅读(196)
评论(0)
推荐(0)
摘要:
只要一个一个比,然后找到价格最少的就可以了,可以用需要的铅笔数去和每种包装里铅笔数取模,如果结果为0,说明正好达到需要的数量,那就算出买这种包装铅笔需要的价格;如果结果不等于0,说明需要多买一份(向上取整),取模+1就可以算出需要买几份,最后就可以算出买这种包装铅笔需要的价格。最后再找到最少价钱的那 阅读全文
posted @ 2022-08-13 10:17
zjtofficial
阅读(57)
评论(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
阅读(28)
评论(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
阅读(30)
评论(0)
推荐(0)
摘要:
字符串读取,字符统计;先按正常的21球,11球,建立两套统计系统,进行处理;11:0或0:11均可,即有可能赢也有可能输;11:9也算一局,所以是有一人达到11球即可。 #include<bits/stdc++.h> using namespace std; int main(){ int w=0, 阅读全文
posted @ 2022-08-13 10:09
zjtofficial
阅读(116)
评论(0)
推荐(0)
摘要:
每个月津津手里的钱都会增加300,津津手里的钱减去这个月的花销等于剩余的钱,若剩余的钱小于0,说明已经透支。 #include<iostream>#include<cmath>using namespace std;int main(){ int spend,money=0,s=0; for(int 阅读全文
posted @ 2022-08-13 10:05
zjtofficial
阅读(43)
评论(0)
推荐(0)
摘要:
可以把陶陶的身高加上椅子的高度看做陶陶的总身高,只要果子的高度<=陶陶的身高,就说明他可以摘到苹果。 #include<iostream>using namespace std;int tree[10];int main(){ int t=0; int height; for(int i=0;i<1 阅读全文
posted @ 2022-08-13 10:01
zjtofficial
阅读(49)
评论(0)
推荐(0)
摘要:
每人的糖果数都用整型定义,分成三份,分别分给相邻的人;输出setw()<iomanip>。 #include<iostream>#include<cstdio>#include<iomanip>using namespace std;int main(){ int a,b,c,d,e; cin>>a 阅读全文
posted @ 2022-08-13 09:58
zjtofficial
阅读(26)
评论(0)
推荐(0)

浙公网安备 33010602011771号