A 水的沸点:
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
cout<<100-n/300;
return 0;
}
B 庆国庆:
#include<iostream>
using namespace std;
int main(){
int n,m=0,f=0;
cin>>n;
for(int i=1;i<=n;i++){
int tmp;
cin>>tmp;
f+=tmp*30;
}
for(int i=1;i<n;i++){
int tmp;
cin>>tmp;
m+=tmp;
}
cout<<f/30*1.0+m;
return 0;
}
C 字符密码:
#include<iostream>
using namespace std;
char daxie[27]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','\0'};
char xiaoxie[27]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','\0'};
int main(){
int ascii=0;
char s[10];
for(int i=1;i<=4;i++){
cin>>s;
ascii+=s;
}
cout<<s[1]<<s[2]<<s[3]<<s[4];
if(ascii%2==0){
cout<<daxie[ascii%26-1];
}
else{
cout<<xiaoxie[ascii%26-1];
}
return 0;
}
D 笔记本价格(90分,没写出AC代码)
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a,b=0;
for(int i=1;i<=n;i++){
int p[15],sum=0;
for(int j=1;j<=12;j++){
cin>>p[j];
sum+=p[j];
}
if(i==1){
a=sum/12;
b=1;
continue;
}
if(a<sum/12){
b=i;
a=sum/12;
}
}
cout<<b;
return 0;
}
|