自己运行没问题,为什么一组也通不过,求助大佬
查看原帖
自己运行没问题,为什么一组也通不过,求助大佬
318876
金城武楼主2020/6/29 17:35
#include <bits/stdc++.h>
using namespace std;
int n;
typedef struct student
{
	int id;
	int xueshucj,sztzcj;
	double score=0.7*xueshucj+0.3*sztzcj;
	double getsum()
	{
		return xueshucj+sztzcj;
	}
}s;
static int v=0;
void isyouxiu(s& u)
{   v++;
	if (u.getsum()>140&&u.score>=80)
	{  if (v!=n)
		cout<<"Excellent"<<endl; 
		else
		cout<<"Excellent";
	}
	else
	{
		if (v!=n)
		cout<<"Not excellent"<<endl;
		else
		cout<<"Not excellent";
	}
	
}
int main ()
{
	
	cin>>n;
	s* ptr=new s[n];
	for (int i=0;i<n;i++)
	{
		cin>>(ptr+i)->id>>(ptr+i)->xueshucj>>(ptr+i)->sztzcj;	
	}
	for (int i=0;i<n;i++)
	{
		isyouxiu(*(ptr+i));
	}

	delete ptr;
 } 
2020/6/29 17:35
加载中...