1328 条题解
-
0
烟花下的浪漫 LV 6 @ 2012-09-16 10:35:48
var a,b:integer;
begin
read(a,b);
write(a+b);
end. -
02012-09-12 21:38:31@
var a,b:integer;
begin
read(a,b);
write(a+b);
end. -
02012-09-11 22:51:20@
var A,B,c:integer;
begin
read('A',A,'B',B);
c:=A+B;
write(c);
end. -
02012-09-11 21:46:40@
var
a,b:array[0..10] of longint;
i,j,k,l:longint;procedure reads(var t1,t2:array of longint);
var
i,j,k,l:longint;
s,s2:string;
begin
readln(s);
i := pos(' ',s);
t1[0] := i-1;
for j := i-1 downto 1 do t1 := ord(s[j]) - ord('0');
t2[0] := length(s) -i;
for j := length(s) downto i+1 do t2[length(s)-j+1] := ord(s[j]) - ord('0');
end;begin
reads(a,b);
for i := 1 to a[0] do
begin
inc(b[i],a[i]);
b := b + b[i] div 10;
b[i] := b[i] mod 10;
end;
for j := i to b[0] do
begin
b := b + b[i] div 10;
b[i] := b[i] mod 10;
end;
while b[b[0]+1] 0 do inc(b[0]);
for i := b[0] downto 1 do write(b[i]); writeln;
end.高精不解释
-
02012-09-11 20:54:59@
var
a,b:integer;
begin
read(a,b);
writeln(a+b);
end. -
02012-09-11 20:28:37@
var
a,b:integer;
begin
readln(a,b);
writeln(a+b);
end. -
02012-09-11 16:51:37@
var
a,b,c:integer;
begin
readln(a,b);
c:=a+b;
writeln(c);
readln;
end. -
02012-08-24 08:29:18@
算法:直接计算
-
02012-08-15 22:11:14@
var
opr:array[0..1000000] of char;
data:array[0..1000000] of longint;
str1:string;
l:longint;
procedure init;
begin
readln(str1);
str1:='(' +str1+')';
l:=length(str1);
end;function count(s1,s2:longint;ch:char):longint;
var
i:longint;
begin
case ch of
'+':count:=s1+s2;
'-':count:=s1-s2;
'*':count:=s1*s2;
'/':count:=s1 div s2;
'^':begin
count:=1;
for i:=1 to s2 do
count:=count*s1;
end;
end;
end;procedure main;
var
topopr,topdata,i,j,s1,s2,s:longint;
ch:char;
begin
i:=1;
topopr:=0;
topdata:=0;
while i0)
then begin
while (opr[topopr]'(') and (topopr>0) do
begin
if s10 then s1:=data[topdata-1];
if s20 then s2:=data[topdata];
ch:=opr[topopr];
opr[topopr]:=' ';
dec(topopr);
data[topdata]:=0;
dec(topdata);
data[topdata]:=count(s1,s2,ch);
end;
end
else begin
if (opr[topopr]='(') and (topopr1)
then begin
opr[topopr]:=' ';
dec(topopr);
inc(i);
end
else begin
writeln(data[topdata]);
exit;
end;
end;
end;
'+','-': begin
if not (opr[topopr]='(')
then begin
while not (opr[topopr] ='(') do
begin
if s10 then s1:=data[topdata-1];
if s20 then s2:=data[topdata];
ch:=opr[topopr];
opr[topopr]:=' ';
dec(topopr);
data[topdata]:=0;
dec(topdata);
data[topdata]:=count(s1,s2,ch);
end;
inc(topopr);
opr[topopr]:=str1[i];
end
else begin
inc(topopr);
opr[topopr]:=str1[i];
end;
inc(i);
end;
'*','/' :begin
if not (opr[topopr] in ['(','+','-'])
then begin
while not (opr[topopr] in ['(','+','-']) do
begin
if s10 then s1:=data[topdata-1];
if s20 then s2:=data[topdata];
ch:=opr[topopr];
data[topdata]:=0;
opr[topopr]:=' ';
dec(topdata);
dec(topopr);
data[topdata]:=count(s1,s2,ch);
end;
inc(topopr);
opr[topopr]:=str1[i];
end
else begin
inc(topopr);
opr[topopr]:=str1[i];
end;
inc(i);
end;
'^':begin
if opr[topopr]='^'
then begin
while opr[topopr]='^' do
begin
if s10 then s1:=data[topdata-1];
if s20 then s2:=data[topdata];
ch:=opr[topopr];
data[topdata]:=0;
opr[topopr]:=' ';
dec(topdata);
dec(topopr);
data[topdata]:=count(s1,s2,ch);
end;
inc(topopr);
opr[topopr]:=str1[i];
end
else begin
inc(topopr);
opr[topopr]:=str1[i];
end;
inc(i);
end;
'0'..'9':begin
j:=i;
s:=ord(str1[j])-48;
inc(j);
while str1[j] in ['0'..'9'] do
begin
s:=s*10+ord(str1[j])-48;
inc(j);
end;
i:=j;
inc(topdata);
data[topdata]:=s;
end;
end;
end;
end;
begin
init;
main;
end. -
02012-08-02 16:34:14@
高端算法自重
直接读入然后输出a+b即可
vijos这样就AC了,不过额外提一下,某些坑X的OJ[不点名了]需要long long类型,否则会溢出,某些更坑X的OJ有a-b的题目类型,啊为什么这个坑?看看UvaOJ上某道题吧= =至于坑到需要高精度的……似乎还没见到过。。 -
02012-07-22 21:22:39@
#include
#include
using namespace std;
int main( )
{
int a,b;
scanf("%d%d",&a,&b);
int c;
c=a^b;
int d;
int e;
d=a&b;
#define Plus1 \
d=d -
02012-07-20 09:14:33@
为什么用cpp写的就一直no cmpiled fpc就能ac 为什么?
-
02012-07-15 09:31:11@
我会说我会用__asm吗(内构汇编)
-
02012-07-11 15:20:56@
楼下的楼下的楼下真是够华丽丽的……各种颜色各种错误……;
基础题目,有够基础的……直接加直接输出,pascal什么的都可以直接算表达式输出…… -
02012-07-10 16:53:40@
program p;
var
a,b:int64;
begin
read(a,b);
write(a+b)
end. -
02012-07-10 10:33:37@
program p1000;
var a,b:integer;
begin
readln(a,b);
writeln(a+b);
end. -
02010-07-27 15:59:21@
编译通过...
-
02010-07-26 20:15:42@
program p1000;
var
a,b:integer;begin
readln(a,b);
writeln(a+b);
end. -
02010-07-24 19:39:13@
哈哈
-
02010-07-22 16:14:40@
program ex;
var x,y:longint;
begin
readln(x,y);
writeln(x+y);
end.
信息
- ID
- 1000
- 难度
- 9
- 分类
- (无)
- 标签
- (无)
- 递交数
- 74842
- 已通过
- 28652
- 通过率
- 38%
- 被复制
- 253