{
===Program by double8fun==
===Instuction==
输入文件 in.txt
程序输出 result.txt
输入文件格式:
第1行 一个n 表示n个数组
第2->n+1行 一行一个Di 表示第i个数组的维数
第n+2->2n+1行 一行一个Si 表示第i个数组的数据类型
第2n+2->3n+1行 一行n个Rj 表示第i个数组的第j个维度的左右边界之差
样例输入1:
====in.txt====
1
2
int64
99 99
==============
a1:array[1..100,1..100] of int64;
==============
样例输入2:
====in.txt====
2
1
2
longint
int64
999
99 99
==============
a1:array[1..1000] of longint;
a2:array[1..100,1..100] of int64;
==============
Si的集合:
real,
single,
double,
extended,
comp,
shortint,
integer,
longint,
byte,
word,
longword,
Int64,
QWord
}
const
p = 1048576;
maxn = 10;
var
ans:extended;
zj:array[1..maxn] of 1..10;
dim:array[1..maxn] of 1..5;
si:array[1..maxn] of int64;
i,j,n,siz,ki,kj,tmp:longint;
s:string;
begin
assign(input,'in.txt');reset(input);
assign(output,'result.txt');rewrite(output);
readln(n);
for i:=1 to n do begin
readln(dim[i]);
end;
for i:=1 to n do begin
readln(s);
if s='single' then zj[i]:=6;
if s='double' then zj[i]:=4;
if s='extended'then zj[i]:=8;
if s='comp' then zj[i]:=10;
if s='shortint' then zj[i]:=8;
if s='integer' then zj[i]:=1;
if s='longint' then zj[i]:=2;
if s='byte' then zj[i]:=4;
if s='word' then zj[i]:=1;
if s='longword' then zj[i]:=2;
if s='int64' then zj[i]:=8;
if s='qword' then zj[i]:=8;
end;
for i:=1 to n do begin
siz:=1;
for j:=1 to dim[i] do begin
read(ki);
inc(ki);
siz:=siz*ki;
end;
si[i]:=siz;
end;
ans:=0;
for i:=1 to n do
ans:=(ans+si[i]*zj[i])/p;
writeln('MB in total:',ans:0:5,'MB');
close(input);
close(output);
end.
08-12
08-12
08-12
08-12
08-12
08-12
09-10