A plus B... again

Given two integers A and B (of no more than 100000 digits each), find their exact sum.

All Submissions
Best Solutions

Point Value: 15
Time Limit: 3.00s
Memory Limit: 16M
Added: Oct 24, 2008

Problem Types: [Show]

Languages Allowed:
C++03, PAS, C, ASM, C#, C++11

Comments (Search)


All the accepted answers were done in C++

As noted, it is possible to do in Pascal, but not in Turbo Pascal or Borland Pascal. Instead, you need the Free Pascal compiler

Integers don't have to be positive ;)

Also you seem to have a limit of 255 - but as I said above the strings might be up to 100,000 characters long. (I know this won't work for Pascal strings; you have to read() into a char array.)

Another note for Pascal users: this also means you have to take out uses crt and clrscr.
(Otherwise, your lines are only 80 characters long, and big strings don't get outputted properly)

lol wow the last two cases have 255 digits for both a and b...

Actually it's more like 99000 characters.
The strings are actually too big for Pascal - you need to manually read input with character arrays.

perhaps the point valued should be upped?

I don't think this problem is any harder than CCC Division.

The numbers are much too long (:P) for any C++ long long/int. (use strings/arrays!)