2021.5.15

Posted CHUNIN

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2021.5.15相关的知识,希望对你有一定的参考价值。

A - Soft Drinking

#include<bits/stdc++.h>
using namespace std;
int main() {
int n,k,l,c,d,p,nl,np;
cin>>n>>k>>l>>c>>d>>p>>nl>>np;
int Yin=k*l/nl;
int Ning=c*d;
int Yan=p/np;
int a1=min(Yin,Ning);
int a2=min(a1,Yan);
cout<<a2/n<<endl;
}

B - Phone Numbers

#include<bits/stdc++.h>
using namespace std;
struct who{
string Name;
int count1;
};

int main() {
int n;
cin>>n;
who Pizz[100],Girl[100],Tax[100];
Pizz[0].count1=-1;
Girl[0].count1=-1;
Tax[0].count1=-1;
int pp=0;
int gg=0;
int tt=0;
for(int i=0;i<n;i++){
int t;
string name;
cin>>t>>name;
int numPizz=0,numGirl=0,numTax=0;
while(t--){
string phone1,phone="";
cin>>phone1;
int p=0,g=0,T=0;
int r=phone1.size();
for(int i=0;i<r;i++){
if(phone1[i]==\'-\')continue;
else phone+=phone1[i];
}
for(int i=0;i<phone.size();i++){

if(i>0){
if(phone[i]==phone[i-1])
T++;
else if(phone[i]<phone[i-1])
p++;
else g++;
}

}
if(T==5)numTax++;
else if(g==5)numGirl++;
else if(p==5)numPizz++;
else numGirl++;

}
//cout<<"Tax="<<numTax<<"Girl="<<numGirl<<"Pizz="<<numPizz<<endl;
if(numTax>Tax[0].count1){
Tax[0].Name=name,Tax[0].count1=numTax,tt=0;
}
else if(numTax==Tax[0].count1){
Tax[++tt].Name=name,Tax[tt].count1=numTax;
}

if(numGirl>Girl[0].count1)
{
Girl[0].count1=numGirl,Girl[0].Name=name,gg=0;
}
else if(numGirl==Girl[0].count1)
{
Girl[++gg].count1=numGirl,Girl[gg].Name=name;
}

if(numPizz>Pizz[0].count1)
{
Pizz[0].count1=numPizz,Pizz[0].Name=name,pp=0;
}
else if(numPizz==Pizz[0].count1)
{
Pizz[++pp].count1=numPizz,Pizz[pp].Name=name;
}
//cout<<pp<<tt<<gg<<endl;

// cout<<"------------------------"<<endl;
// if(gg==0)cout<<Girl[0].Name<<endl;
//else{
// int v;
// for(int v=0;v<gg-1;v++){
// cout<<Girl[v].Name<<", ";
// }
// cout<<Girl[v].Name<<endl;
//}
//
//cout<<"---------------------------------------"<<endl;
//if(pp==0)cout<<Pizz[0].Name<<endl;
//else{
// int v;
// for(int v=0;v<pp-1;v++){
// cout<<Pizz[v].Name<<", ";
// }
// cout<<Pizz[v].Name<<endl;;
//}
//cout<<"-----------------------------------"<<endl;
// if(tt==0)cout<<Tax[0].Name<<endl;
//else{
// int v;
// for(int v=0;v<tt-1;v++){
// cout<<Tax[v].Name<<", ";
// }
// cout<<Tax[v].Name<<endl;
//}

}
int v;
cout<<"If you want to call a taxi, you should call: ";
for(v=0;v<tt;v++){
cout<<Tax[v].Name<<", ";
}
cout<<Tax[v].Name<<"."<<endl;

cout<<"If you want to order a pizza, you should call: ";

for(v=0;v<pp;v++){
cout<<Pizz[v].Name<<", ";
}
cout<<Pizz[v].Name<<"."<<endl;;
cout<<"If you want to go to a cafe with a wonderful girl, you should call: ";
for(v=0;v<gg;v++){
cout<<Girl[v].Name<<", ";
}


cout<<Girl[v].Name<<"."<<endl;
}

 

以上是关于2021.5.15的主要内容,如果未能解决你的问题,请参考以下文章

转发一张网络工程师考试的试卷2021.5.15

Mculover666的博客文章导航(嵌入式宝藏站)(2021.05.14更新)

MSSQL·查询存储过程中的关键字

计算机硬件基础-----写在最后

因活跃度不够,阿里巴巴主导的Weex从Apache Incubator退休

LeetCode13. 罗马数字转整数 / 剑指 Offer 42. 连续子数组的最大和 / 剑指 Offer 43. 1~n 整数中 1 出现的次数