Howdy guys,can someon tell me why i can't pass Test 6,i am pretty sure my code is working fine. Can you give me any hint why it doesnt work,please help. Thanks in advance :)
Buka Problem...
1000000000000000000000000000000
*
10000000000000000000000000000000000
Note, a and b are not integers.
I think that checker not work right.
*
10000000000000000000000000000000000
Note, a and b are not integers.
I think that checker not work right.
@Halil,i tried using float,long int,double,but it still doesnt work,which variable type should i use ?
char[100]. Read again text of task.
Hmm,i didn't understood that part,i can't solve it,i may try solve it later :)
Task difficulty = 2.
1000000000000000000000000000000
*
10000000000000000000000000000000000
=
10000000000000000000000000000000000000000000000000000000000000000
1000000000000000000000000000000
+
10000000000000000000000000000000000
=
10001000000000000000000000000000000
1000000000000000000000000000000
*
10000000000000000000000000000000000
=
10000000000000000000000000000000000000000000000000000000000000000
1000000000000000000000000000000
+
10000000000000000000000000000000000
=
10001000000000000000000000000000000
implement big numbers ...
Wait,i need to limit the output to 100 chars ?
???
well you need big numbers in this task ...
so integer goes to 2^32 and that is 10 digits,
but in this task number can has 100 digits ...
so input can be:
10000...000 // (10^100)
*
10000...000 // (10^100)
and solution is
10000...000 // (10^200)
well you need big numbers in this task ...
so integer goes to 2^32 and that is 10 digits,
but in this task number can has 100 digits ...
so input can be:
10000...000 // (10^100)
*
10000...000 // (10^100)
and solution is
10000...000 // (10^200)
So how can i make it accept more then 10 digits ?
ok ...
let's take for example 1 number
1234567
so you can save it in array of integer with 7 places ...
let say that digit[] is array of integer
so then we can put that number in array like this
digit[0] = 1
digit[1] = 2
digit[2] = 3
and so on ...
digit[6] = 7
// sometimes is better to save number in array in reverse order ...
so digit[0] = 7, digit[1] = 6, ... , digit[6] = 1 ...
but it is on you how you more like and how is easier to implement for you
and we can implement functions that can work with big numbers ...
such as multiplication, addition ...
try to think how you can implement those function:
BigNumber Multiplication( BigNumber a, BigNumber b );
BigNumber Addition( BigNumber a, BigNumber b );
where BigNumber is a structure or class:
class BigNumber {
bool negativ;
int digit[MaxDigits];
int numberOfDigits;
}
let's take for example 1 number
1234567
so you can save it in array of integer with 7 places ...
let say that digit[] is array of integer
so then we can put that number in array like this
digit[0] = 1
digit[1] = 2
digit[2] = 3
and so on ...
digit[6] = 7
// sometimes is better to save number in array in reverse order ...
so digit[0] = 7, digit[1] = 6, ... , digit[6] = 1 ...
but it is on you how you more like and how is easier to implement for you
and we can implement functions that can work with big numbers ...
such as multiplication, addition ...
try to think how you can implement those function:
BigNumber Multiplication( BigNumber a, BigNumber b );
BigNumber Addition( BigNumber a, BigNumber b );
where BigNumber is a structure or class:
class BigNumber {
bool negativ;
int digit[MaxDigits];
int numberOfDigits;
}
hint about implementation:
do it like you are doing it on paper ...
1234 * 56
-------------------
7404
+ 6170
-------------------
69104
do it like you are doing it on paper ...
1234 * 56
-------------------
7404
+ 6170
-------------------
69104
Easy to solve without big number aritmetics.
Just read it one more time. ( ... potency of 10 ... )
i haven't read task, i have just read this topic so i supposed that it is problem with big numbers ...
if number is potency of 10 then you don't need big numbers ...
if number is potency of 10 then you don't need big numbers ...
@ Aleksandar S.(pK-lst)
http://zadaci.pastebin.com/m639c424a
http://zadaci.pastebin.com/m639c424a
Ohh,i see now,thank you halil,later i will try solve it on my own :)
@Fahrudin can you add me on MSN ?
E-Mail : alek.stankovski@live.com
E-Mail : alek.stankovski@live.com