1113 - #include /* */ using namespace std; enum...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<cstdio> # /** ±¾³ÌÐòͨ²»¹ý£¬ÔÒòδ֪ **/ using namespace std; enum { Size = 16, }; } typedef struct { int num; char data[Size]; }Node ; } Node initvalue={1,{1,0}}; Node divalue= initvalue; N int i=0; int carry = 0; do{ carry = 10 * carry +v.data[i]; v.data[i] = carry / n; carry = carry % n; i ++; if(i >= 16) break; }while(i<v.num || carry); v.num = i; } int i; int carry = 0; v.num = n.num; i = v.num -1; while(i>=0){ carry = carry + n.data[i] + v.data[i]; v.data[i] = carry % 10; carry /= 10; i--; } } Node node = old; N
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/18/2010 for the course CS 100 taught by Professor Acm during the Spring '10 term at Zhejiang University.

Page1 / 2

1113 - #include /* */ using namespace std; enum...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online