2021蓝桥杯
A
#include <iostream>
using namespace std;
int main()
{
cout<<256/32*1024*1024*8;
return 0;
}
基础的一道题,但因为计算机知识不过关导致做错了。
B
#include<iostream>
using namespace std;
int main()
{
int a[10];
for( int i=0; i<10 ;i++){
a[i]=2021;
}
int cmp=0;
int ds=1;
for( int i=1; ; i++){
int b=i;
do{
a[b%10]--;
if(a[b%10]==0){
ds=0;break;
}
b/=10;
}while(b>0);
if(ds==0) break;
cmp++;
}
cout<<cmp+1<<endl;
}
比赛好像要加1,但是忘了。
C
D
E
F
#include <iostream>
using namespace std;
int main()
{
long long int t;
cin>>t;
t /= 1000;
t %= 60*60*24;
int h = t/3600;
t %= 3600;
int m = t/60;
int s = t%60;
printf("%.2d:%.2d:%.2d",h ,m ,s);
return 0;
}
签到题
G