cicion虛擬貨幣
1. 求C語言寫的高精度除法代碼!!!!!!
這個不是C語言。是pas語言。。。。不過看看把,差不多。
其實這個演算法不難,就是數組模擬除法操作,稍微想像很容易的。Acm比賽中的基本演算法。
我沒有寫這個程序,從信息初學者那裡找了兩個演算法,pascal寫的,根據你用的語言自己轉化下吧,以前用c++寫的找不到了:(
除法 1 : 高精度數 / 單精度數
{
Author : tenshi
Date : 2002-03-10
Problem : High Precision --- Divide
Algorithm : simple
Input : two lines,
1st line : a positive HighPrecision Number
2nd line : a positive Low Precicion Number
Output : times & rest of the two Numbers
}
program HighPrecision3_Multiply1;
const
fn_inp='hp5.inp';
fn_out='hp5.out';
maxlen=100; { max length of the number }
type
hp=record
len:integer; { length of the number }
s:array[1..maxlen] of integer
{ s[1] is the lowest position
s[len] is the highest position }
end;
var
x,y:hp;
z,w:integer;
procere PrintHP(const p:hp);
var i:integer;
begin
for i:=p.len downto 1 do write(p.s[i]);
end;
procere init;
var
st:string;
i:integer;
begin
assign(input,fn_inp);
reset(input);
readln(st);
x.len:=length(st);
for i:=1 to x.len do { change string to HP }
x.s[i]:=ord(st[x.len+1-i])-ord('0');
readln(z);
close(input);
end;
procere Divide(a:hp;b:integer;var c:hp;var d:integer);
{ c:=a div b ; d:=a mod b }
var i,len:integer;
begin
fillchar(c,sizeof(c),0);
len:=a.len;
d:=0;
for i:=len downto 1 do { from high to low }
begin
d:=d*10+a.s[i];
c.s[i]:=d div b;
d:=d mod b;
end;
while(len>1) and (c.s[len]=0) do dec(len);
c.len:=len;
end;
procere main;
begin
Divide(x,z,y,w);
end;
procere out;
begin
assign(output,fn_out);
rewrite(output);
PrintHP(y);
writeln;
writeln(w);
close(output);
end;
begin
init;
main;
out;
end.
除法 2 : 高精度數 / 高精度數
{
Author : tenshi
Date : 2002-03-10
Problem : High Precision --- Divide
Algorithm : simple
Input : two lines, each line a positive HighPrecision Number
Output : quotient & molus of the two HighPrecision Numbers
}
program HighPrecision4_Multiply2;
const
fn_inp='hp6.inp';
fn_out='hp6.out';
maxlen=100; { max length of the number }
type
hp=record
len:integer; { length of the number }
s:array[1..maxlen] of integer
{ s[1] is the lowest position
s[len] is the highest position }
end;
var
x:array[1..2] of hp;
y,w:hp; { x:input ; y:output }
procere PrintHP(const p:hp);
var i:integer;
begin
for i:=p.len downto 1 do write(p.s[i]);
end;
procere init;
var
st:string;
j,i:integer;
begin
assign(input,fn_inp);
reset(input);
for j:=1 to 2 do
begin
readln(st);
x[j].len:=length(st);
for i:=1 to x[j].len do { change string to HP }
x[j].s[i]:=ord(st[x[j].len+1-i])-ord('0');
end;
close(input);
end;
procere Subtract(a,b:hp;var c:hp); { c:=a-b, suppose a>=b }
var i,len:integer;
begin
fillchar(c,sizeof(c),0);
if a.len>b.len then len:=a.len { get the bigger length of a,b }
else len:=b.len;
for i:=1 to len do { subtract from low to high }
begin
inc(c.s[i],a.s[i]-b.s[i]);
if c.s[i]<0 then
begin
inc(c.s[i],10);
dec(c.s[i+1]); { add 1 to a higher position }
end;
end;
while(len>1) and (c.s[len]=0) do dec(len);
c.len:=len;
end;
function Compare(const a,b:hp):integer;
{
1 if a>b
0 if a=b
-1 if a<b
}
var len:integer;
begin
if a.len>b.len then len:=a.len { get the bigger length of a,b }
else len:=b.len;
while(len>0) and (a.s[len]=b.s[len]) do dec(len);
{ find a position which have a different digit }
if len=0 then compare:=0 { no difference }
else compare:=a.s[len]-b.s[len];
end;
procere Multiply10(var a:hp); { a:=a*10 }
var i:Integer;
begin
for i:=a.len downto 1 do
a.s[i+1]:=a.s[i];
a.s[1]:=0;
inc(a.len);
while(a.len>1) and (a.s[a.len]=0) do dec(a.len);
end;
procere Divide(a,b:hp;var c,d:hp); { c:=a div b ; d:=a mod b }
var i,j,len:integer;
begin
fillchar(c,sizeof(c),0);
len:=a.len;
fillchar(d,sizeof(d),0);
d.len:=1;
for i:=len downto 1 do
begin
Multiply10(d);
d.s[1]:=a.s[i]; { d:=d*10+a.s[i] }
{ c.s[i]:=d div b ; d:=d mod b; }
{ while(d>=b) do begin d:=d-b;inc(c.s[i]) end }
while(compare(d,b)>=0) do
begin
Subtract(d,b,d);
inc(c.s[i]);
end;
end;
while(len>1)and(c.s[len]=0) do dec(len);
c.len:=len;
end;
procere main;
begin
Divide(x[1],x[2],y,w);
end;
procere out;
begin
assign(output,fn_out);
rewrite(output);
PrintHP(y);
writeln;
PrintHP(w);
writeln;
close(output);
end;
begin
init;
main;
out;
end.
2. .星期五下午Cici可以回家,通常要花大約三個半小時才能到家的英語
cici can go home on Friday,it usually takes her 3.5 hours to get to her home.
3. ACCESS 用sql語句:例如:alter table時 如何 為欄位 指定 精度 數值范圍
access 應該是不支持 numeric(m,n)的數據類型。
4. 關於西班牙語的間接賓語
1. nos就是賓格代詞所謂直接賓語出現,convenia的主語是ejecución
2. 是自復動詞的用法(台灣的書好像稱之反身動詞)即quedarse相當於estar,多問問你的老師,畢竟口頭的傳授勝過這種筆頭的解釋。
另外你這兩句似乎都有點小錯誤啊,既然求教是否應當持有一個嚴謹的態度,這樣也許早就有人在我之前答復您了~
5. 銀河護衛隊星爵要阻止羅南摧毀山達爾星之前整理裝備的背景音樂,唱的好像是「cicicicicicic
1. Blue Swede - Hooked on a Feeling
2. Raspberries - Go All the Way
3. Norman Greenbaum - Spirit in the Sky
4. David Bowie - Moonage Daydream
5. Elvin Bishop - Fooled Around and Fell in Love
6. 10Cc - I'm Not in Love
7. Jackson 5 - I Want You Back
8. Redbone - Come and Get Your Love
9. The Runaways - Cherry Bomb
10. Rupert Holmes - Escape (the Pina Colada Song)
11. The Five Stairsteps - O-O-H Child
12. Marvin Gaye/Tammi Terrell - Ain't No Mountain High Enough