mashin hesab

Jul 10, 2012 at 3:47pm
من می‌خواهم یک ماشین حساب ساده بنویسم که بتواند حتی دو عدد صد رقمی را هم جمع کند و الآن فقط نوشتن جمع با دو عدد
int_64
و کوچکتر را بلدم. در ضمن محیط مورد استفاده‌ی من
microsoft visual studio 2010
Jul 10, 2012 at 4:09pm
Sorry, but I'd say most of us can't read that.

EDIT:

Google translate gets something along the lines of...

You want to write a calculator that can calculate numbers up to 200 digits? You'll probably need to use a library for that.
Last edited on Jul 10, 2012 at 4:11pm
Jul 10, 2012 at 5:15pm
I made a program like that once in C++. You can accomplish this by using a stack. I created my own stack class using vectors. Then it's just a matter of reading in the numbers as strings, and pushing each digit onto the stack with a for loop.

1
2
3
for (int i = 0; i < this->firstNum.length(); i++) {
    this->s1.push(this->firstNum.at(i));
}

and finally calculate each digit individually by popping it off the stack and adding/subtracting/whatever to it.
Jul 10, 2012 at 5:38pm
Guys try translating your answers, it might help
Jul 10, 2012 at 5:51pm
I doubt it'll help THAT much. Going from Persian (according to google) to english was pretty rough. I'm sure going back again would be pretty bad as well.
Topic archived. No new replies allowed.