- 谁拿了最多奖学金
- 2009-09-23 21:06:52 @
大家帮我看一下,运行后输入,输出不了,显示程序错误
#include
using namespace std;
int main()
{
int n,i;
cin>>n;
n=n-1;
int cj[n],py[n],lw[n],money[n],max,sum;
char xg[n],xb[n];
string name[n],who;
for(i=0;i>name[i]>>cj[i]>>py[i]>>xg[i]>>xb[i]>>lw[i];}
for(i=0;i80&&xg[i]=='Y')money[i]+=850;
if(cj[i]>85&&xb[i]=='Y')money[i]+=1000;
if(cj[i]>90)money[i]+=2000;
if(cj[i]>85&&py[i]>80)money[i]+=4000;
if(cj[i]>80&&lw[i]>=1)money[i]+=8000;}
max=money[0];
who=name[0];
sum=0;
for(i=1;i
1 条评论
-
zhqc LV 9 @ 2009-09-23 22:50:03
cin>>name[i]>>cj[i]>>py[i]>>xg[i]>>xb[i]>>lw[i];}
需要读入一个字符串然后再慢慢处理……数字和字符串不能混读
- 1