讨论 / 这两题没错,可是判题时说无输出,是怎么回事??跪求大牛!
LJJ1670221870 2013-03-02 17:38:00
点我顶贴 收藏 删除
16

16

16

#include<iostream>

using namespace std;

int main()

{

int a,c[100],d[100],h[100]={0},g[100],zd=0,t=1,x=0;

string b[100];

char f[100],e[100];

cin>>a;

for (int i=1;i<=a;i++)

{

cin>>b[i]>>c[i]>>d[i]>>e[i]>>f[i]>>g[i];

}

for (int i=1;i<=a;i++)

{

if (c[i]>80&&g[i]>=1)h[i]+=8000;

if (c[i]>85&&d[i]>80)h[i]+=4000;

if (c[i]>90)h[i]+=2000;

if (c[i]>85&&f[i]=='Y')h[i]+=1000;

if (d[i]>80&&e[i]=='Y')h[i]+=850;

x=x+h[i];

}

zd=h[1];

for (int i=1;i<=a;i++)

{

if (h[i]>zd){zd=h[i];t=i;}

}

cout<<endl<<b[t]<<endl<<h[t]<<endl<<x<<endl;

system("pause");

return 0;

}

133

133

133

#include<iostream>

using namespace std;

int main()

{

int a,b[200001]={0},c[200001]={0};

cin>>a;

for (int i=1;i<=a;i++)

{cin>>b[i];}

for (int i=1;i<=a;i++)

{c[b[i]]++;}

for (int i=1;i<=100001;i++)

{if (c[i]>0)cout<<i<<" "<<c[i]<<endl;}

system("pause");

return 0;

}

#1 LJJ1670221870@2013-03-02 17:38:00
回复 删除
[quote][url=/Discuss_Show.asp?DID=11872]原帖[/url]由 [i]LJJ1670221870[/i] 于 2013-2-11 11:22:00 发表

16

16

16

#include<iostream>

using namespace std;

int main()

{

int a,c[100],d[100],h[100]={0},g[100],zd=0,t=1,x=0;

string b[100];

char f[100],e[100];

cin>>a;

for (int i=1;i<=a;i++)

{

cin>>b[i]>>c[i]>>d[i]>>e[i]>>f[i]>>g[i];

}

for (int i=1;i<=a;i++)

{

if (c[i]>80&&g[i]>=1)h[i]+=8000;

if (c[i]>85&&d[i]>80)h[i]+=4000;

if (c[i]>90)h[i]+=2000;

if (c[i]>85&&f[i]=='Y')h[i]+=1000;

if (d[i]>80&&e[i]=='Y')h[i]+=850;

x=x+h[i];

}

zd=h[1];

for (int i=1;i<=a;i++)

{

if (h[i]>zd){zd=h[i];t=i;}

}

cout<<endl<<b[t]<<endl<<h[t]<<endl<<x<<endl;

system("pause");

return 0;

}

133

133

133

#include<iostream>

using namespace std;

int main()

{

int a,b[200001]={0},c[200001]={0};

cin>>a;

for (int i=1;i<=a;i++)

{cin>>b[i];}

for (int i=1;i<=a;i++)

{c[b[i]]++;}

for (int i=1;i<=100001;i++)

{if (c[i]>0)cout<<i<<" "<<c[i]<<endl;}

system("pause");

return 0;

}[/quote]

#2 LJJ1670221870@2013-03-02 17:38:00
回复 删除
[quote][url=/Redirect.asp?Act=Reply&DID=11872&RID=29479]原帖[/url]由 [i]LJJ1670221870[/i] 于 2013-3-3 9:38:00 发表

[/quote]

查看更多回复
提交回复