# 三月份蓝桥杯刷题--3.9

Persistence 2023-03-09 21:16:11
``````//星期计算
#include <iostream>
#include<vector>
using namespace std;
int main()
{
cout<<7;
// 对20的22次方对七取余可得到6的22次方，将6的22次方转换为36的11次方再对7取余可得1的11次方即为1。所以20的22次方取余7等于1，故结果等于6+1=7。
return 0;
}
``````

https://www.lanqiao.cn/problems/2140/learning/?page=2&first_category_id=1&sort=students_count&second_category_id=3&tags=2022

``````//考勤刷卡
#include <iostream>
#include<algorithm>
using namespace std;
int id[110];
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
string s;
cin>>s>>id[i];
}
sort(id,id+n);
for(int i=0;i<n;i++)
if(id[i]!=id[i+1]) cout<<id[i]<<endl;
return 0;
}
``````

https://www.lanqiao.cn/problems/2380/learning/?page=1&first_category_id=1&sort=students_count&second_category_id=3&tags=2022

``````//卡片
#include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
for(int i=2;;i++)
{
if(i*(i+1)/2>=n){
printf("%d",i);
break;
}
}
return 0;
}
``````

https://www.lanqiao.cn/problems/2383/learning/?page=2&first_category_id=1&sort=students_count&second_category_id=3&tags=2022

...全文
3 回复 打赏 收藏 举报

3.2w+

2023-03-09 21:16

刷题！