大佬们救救我,为什么题例过了,我还是0分,我活不下去了

#include<iostream>
#include<cstring>
using namespace std;
class STUDENT{
private:
char name;
int score1;
int score2;
char ifleader;
char ifwest;
int scholar;
public:
STUDENT(char a[],int a1,int a2,char YN,char yn,int number){
name=a;
score1=a1;
score2=a2;
ifleader=YN;
ifwest=yn;
scholar=number;
}
int panduan(){
int award=0;
if(score2>80&&ifleader=='Y'){
award+=850;
}
if(score1>85&&score2>80){
award+=4000;
}
if(score1>85&&ifwest=='Y'){
award+=1000;
}
if(score1>80&&scholar>=1){
award+=8000;
}
if(score1>90){
award+=2000;
}
return award;
}
char
showname(){
return name;
}
}
;
int main(){
int account;
STUDENT *ptr[101];
char namer[20];
char *point;
int max=0;
char a[30];
int b,c,f;
int total=0;
char d,e;
int i;
cin>>account;
for(i=0;i<account;i++){
cin.getline(a,30,' ');
cin>>b>>c>>d>>e>>f;
ptr[i]=new STUDENT(a,b,c,d,e,f);
total+=ptr[i]->panduan();
if(max<ptr[i]->panduan()){
point=strcpy(namer,ptr[i]->showname());
max=ptr[i]->panduan();
}
}
cout<<point<<endl;
cout<<max<<endl;
cout<<total;
delete ptr;
}

3 条评论

  • 1

信息

ID
1001
难度
5
分类
模拟 点击显示
标签
递交数
39307
已通过
12806
通过率
33%
被复制
132
上传者