郁闷啊
好不容易进了复赛
而且……
第一题编的差不多了的
就是“学生名字的读入”没搞定
结果省2等奖泡汤了
(米是四川的,有一道题做出来就2等的,才学两月,满足了)
~~~~~~~
谁能告诉我
那“名字”(字符串)怎么读
拜托拉!
THANK YOU!
下面是我的源程序
各位老鸟大哥们帮个忙哈
program scholar;
var
n{学生人数}:integer;
ch1{是否干部},ch2{是否西部的},chk{空格}:char;
ch:array[1..20] of char;
a{班末平均成绩},b{班级评议},c{论文数},i,l,j,k:longint;
stu{学生名字}:array[1..100]of string[20];
money:array[1..100]of integer;
total1{名字占的字符数},total2{钱总数}:integer;
f1.f2:text;
begin
assign(f1,'scholar.in');
reset(f1);
readln(f1,n);
for i:=1 to n do
begin
total1:=0;
repeat
begin
read(f1,ch[l]);
total1:=total1+1;
end
until ch[l]=' ';
stu
:='';
for l:=1 to total1 do
stu:=stu+ch[l]);
read(f1,a,b,chk,ch1,chk,ch2,c);
readln(f1);
{ 读数据部分 }
money:=0;
if (a>80) and (a<=100) and (c>=1) and (c<=10)
then money:=money+8000;
if (a>85) and (a<=100) and (b>80) and (b<=100)
then money:=money+4000;
if (a>90) and (a<=100)
then money:=money+2000;
if (a>85) and (a<=100) and (ch2='Y')
then money:=money+1000;
if (b>80) and (b<=100) and (ch1='Y')
then money:=money+850;
{ 算钱 }
end;
close(f1);
total2:=0;
for i:=1 to n do total2:=total2+money;
{算总钱}
for i:=1 to (n-1) do
for j:=i+1 to n do
if money<money[j] then
begin
k:=money;
money:=money[j];
money[j]:=k;
end;
{从高到底排序}
assign(f2,'scholar.out');
rewrite(f2);
writeln(f2,stu[1]);
writeln(f2,money[1]);
writeln(f2,total2);
close(f2);
end.

[ 此贴被little影在2005-12-06 18:58重新编辑 ]