Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

out of control

Status
Not open for further replies.

dnfrantum

Programmer
Oct 23, 2001
175
US
This code went wildly out of control and I can't figure out why. It compiled o.k., but when I ran it, it just kept growing and growing the file. What I want out of this code is to input a file of variable length records comprised of digits and for it to return a file of fixed length digits (5)with the appropriate header and footer information per 100 records.

ex. number = 5 digit number

00430100number x 100mgr 20030903010101
00430101number x 100mgr
20030903010101


00430102number x 100mgr
20030903010101

Here is the code that I have so far,

/* Donald Frantum */

#include <iostream.h>
#include <ctype.h>
#include <fstream.h>
#include <string>
#include <iomanip.h>


void main()
{
int ship_method = 0;
int zone = 0;
int company = 0;
string in_file;
string out_file;

cout << &quot;This program creates a P&H table to be loaded into the&quot; << endl;
cout << &quot;Ecometry PH-DOLLARS dataset.&quot; << endl;
cout << endl;
cout << endl;
cout << &quot;Please enter the Ship Method that you wish to apply&quot; << endl;
cout << &quot;these shipping charges and <enter>:&quot; << endl;
cin >> ship_method;
cout << &quot;Please enter the zone that you wish to apply to these&quot; << endl;
cout << &quot;charges and <enter>:&quot; << endl;
cin >> zone;
cout << &quot;Please enter the company that you wish to apply these&quot; << endl;
cout << &quot;charges and <enter>:&quot; << endl;
cin >> company;
cout << &quot;Please enter the path where the input file can be found:&quot; << endl;
cin >> in_file;
cout << &quot;Please enter the path where the output file should be placed:&quot; << endl;
cin >> out_file;

ifstream zone_chrg_input;
zone_chrg_input.open(in_file.c_str());
ofstream out;
out.open(out_file.c_str());

int c;
int i;
int count[5];
long line_cnt = 0;
long where_i_am = 100;
long range = 0;
int digit_cnt = 0;

if (company < 10)
{
out << setw(2) << setfill('0') << company;
}
if (ship_method < 10)
{
out << setw(2) << setfill('0') << ship_method;
}
else
{
out << ship_method;
}
if (zone < 10)
{
out << setw(2) << setfill('0') << zone;
}
if (range < 10)
{
out << setw(2) << setfill('0') << range << &quot; &quot;;
}
line_cnt = 0;
while ( (c = zone_chrg_input.get() ) !=EOF )
{
while (line_cnt <= where_i_am)
{
if (isdigit(c) && digit_cnt < 5 && c != '\n')
{
i = 0;
for(i = 0; i < 5; i++)
{
count = c;
}
out << setw(5) << setfill('0') << count;
}
if (c == '\n')
{
line_cnt = ++line_cnt;
}
}
range = ++range;
where_i_am = where_i_am + 100;
out << setw(8) << setfill(' ');
out.setf(ios::left);
out << &quot;MGR&quot;;
out << setw(92) << setfill(' ');
out.setf(ios::left);
out << &quot;20030905010101&quot;;
if (range < 100)
{
if (company < 10)
{
out << setw(2) << setfill('0') << company;
}
if (ship_method < 10)
{
out << setw(2) << setfill('0') << ship_method;
}
else
{
out << ship_method;
}
if (zone < 10)
{
out << setw(2) << setfill('0') << zone;
}
if (range < 10)
{
out << setw(2) << setfill('0') << range << &quot; &quot;;
}
}
if (company < 10)
{
out << setw(2) << setfill('0') << company;
}
if (ship_method < 10)
{
out << setw(2) << setfill('0') << ship_method;
}
else
{
out << ship_method;
}
if (zone < 10)
{
out << setw(2) << setfill('0') << zone;
}
if (range < 10)
{
out << setw(2) << setfill('0') << range << &quot; &quot;;
}
}
zone_chrg_input.close();
out.close();
}

Any help is appreciated.

Thanks in advance,
Donald
 
Here are some hints to get you started:[ol][li]Use code tags when posting: they make it easier to read your code and help avoid accidental italics.[/li]
[li]Use the correct headers: iostream.h, ctype.h, fstream.h and iomanip.h are deprecated and should be replaced by iostream, cctype, fstream and iomanip. Putting
Code:
using namespace std;
under the includes should allow you to avoid changes to your code due to the use of the correct headers.[/li]
[li]Use int main(): even though your compiler may allow void and your tutorial/book/instructor might use void, main is supposed to return an int, so you might as well do it the correct way.[/li]
[li]You have an infinite loop:
Code:
while ( (c = zone_chrg_input.get() ) !=EOF )
{
    while (line_cnt <= where_i_am)
    {
        if (isdigit(c) && digit_cnt < 5 && c != '\n')
        {
            i = 0;
            for(i = 0; i < 5; i++)
            {
                count[i] = c;
            }
            out << setw(5) << setfill('0') << count;
        }
        if (c == '\n')
        {
            line_cnt = ++line_cnt;
        }
    }
    ...
}
Your inner loop keeps checking the same c, so if c is not '\n' originally then it will loop forever because line_cnt will never get incremented. I assume you want to check this once for each character you read in, so maybe you should put the loop that reads the characters on the inside and the line count on the outside.[/li][/ol]Hope that gets you started. Sorry, I don't understand enough of what you are trying to accomplish to help further right now.
 
I think that I am almost there, I am just having one issue...

Here is my code:
Code:
/* Donald Frantum */

#include <iostream.h>
#include <ctype.h>
#include <fstream.h>
#include <string>
#include <iomanip.h>


void main()
{
int ship_method = 0;
int zone = 0;
int company = 0;
string in_file;
string out_file;

      cout << &quot;This program creates a P&H table to be loaded into the&quot; << endl;
      cout << &quot;Ecometry PH-DOLLARS dataset.&quot; << endl;
      cout << endl;
      cout << endl;
      cout << &quot;Please enter the Ship Method that you wish to apply&quot; << endl;
      cout << &quot;these shipping charges and <enter>:&quot; << endl;
      cin >> ship_method;
      cout << &quot;Please enter the zone that you wish to apply to these&quot; << endl;
      cout << &quot;charges and <enter>:&quot; << endl;
      cin >> zone;
      cout << &quot;Please enter the company that you wish to apply these&quot; << endl;
      cout << &quot;charges and <enter>:&quot; << endl;
      cin >> company;
      cout << &quot;Please enter the path where the input file can be found:&quot; << endl;
      cin  >> in_file;
      cout << &quot;Please enter the path where the output file should be placed:&quot; << endl;
      cin  >> out_file;
      
      ifstream zone_chrg_input;
      zone_chrg_input.open(in_file.c_str());
      ofstream out;
      out.open(out_file.c_str());
      
      int c;
      int i;
      int count[5];
      long line_cnt = 0;
      long where_i_am = 100;
      long range = 0;
      int digit_cnt = 0;
      
      if (company < 10)
         {
         out << setw(2) << setfill('0') << company;
         }
      if (ship_method < 10)
         {
         out << setw(2) << setfill('0') << ship_method;
         }
         else
         {
         out << ship_method;
         }
      if (zone < 10)
         {
         out << setw(2) << setfill('0') << zone;
         }      
      if (range < 10)
         {
         out << setw(2) << setfill('0') << range << &quot;  &quot;;
         }
         line_cnt = 0;
               while ( (c = zone_chrg_input.get() ) !=EOF )
               {
                  while (line_cnt <= where_i_am)
                  {
                     i = 0;
                          for(i = 0; i <= 5 && isdigit(c) && c != '\n'; i++)
                        {
                        count[i] = c;
                        }
                     out << setw(5) << setfill('0') << count;
                     line_cnt = ++line_cnt;
                  }
               range = ++range;
               where_i_am = where_i_am + 100;
               out << setw(8) << setfill(' ');
               out.setf(ios::left);
               out << &quot;MGR&quot;;
               out << setw(92) << setfill(' ');
               out.setf(ios::left);
               out << &quot;20030905010101&quot;;
               out.setf(ios::right);
               if (company < 10)
                  {
                  out << setw(2) << setfill('0') << company;
                  }
               if (ship_method < 10)
                  {
                  out << setw(2) << setfill('0') << ship_method;
                  }
               else
                  {
                  out << ship_method;
                  }
               if (zone < 10)
                  {
                  out << setw(2) << setfill('0') << zone;
                  }      
               if (range < 10)
                  {
                  out << setw(2) << setfill('0') << range << &quot;  &quot;;
                  }
               else
                  {
                  out << setw(2) << setfill('0') << range << &quot; &quot;;
                  }
               }      
zone_chrg_input.close();
out.close();
}

And here is a portion of my output:
00430200 0x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde00x22fde0MGR 20030905010101
I am not sure what '0x22fde0' is, since it is not the number in my original in file.

Any help, as always, is appreciated.

Thanks in advance,
Donald
 
That 0x22fde0 is the address in memory that your count variable points to. Since count is an array of integers, you cannot just output it using the line:
Code:
out << setw(5) << setfill('0') << count;
If you want to output one member of the array use:
Code:
out << setw(5) << setfill('0') << count[0];
or if you want to output each member you can just put it into your for loop:
Code:
out << setw(5) << setfill('0') << count[i];

I have a feeling this still won't do what you want, but it should get you closer.

And by the way, in your for loop you go from i = 0 to i<=5. That means you will have 6 iterations through the loop and you will fall off the end of your count array. Change the for loop to use < instead of <= :
Code:
for(i = 0; i < 5 && isdigit(c) && c != '\n'; i++)

 
Well, I am not sure how much closer this got me. I am now getting 2293756 instead of the 22fde00x that I was getting before, so I am still lost.

BTW, thank you for the post script, I fixed that.

Thanks in advance,
Donald
 
Just for fun, why don't you post your input file (or at least a small portion of it), the input you type when the program runs, and your expected output.
 
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4000
4007
4029
4050
4072
4093
4115
4136
4157
4179
4200
4222
4243
4265
4286
4307
4329
4350
4372
4393
4415
4436
4457
4479
4500
4522
4543
4565
4586
4607
4629
4650
4672
4693
4715
4736
4757
4779
4800
4822
4843
4865
4886
4907
4929
4950
4972
4993
5015
5036
5057
5079
5100
5122
5143
5165
5186
5207
5229
5250
5272
5293
5315
5336
5358
5379
5400
5422
5443
5465
5486
5508
5529
5550
5572
5593
5615
5636
5658
5679
5700
5722
5743
5765
5786
5808
5829
5850
5872
5893
5915
5936
5958
5979
6000
6022
6043
6065
6086
6108
6129
6150
6172
6193
6215
6236
6258
6279
6300
6322
6343
6365
6386
6408
6429
6450
6472
6493
6515
6536
6558
6579
6600
6622
6643
6665
6686
6708
6729
6750
6772
6793
6815
6836
6858
6879
6900
6922
6943
6965
6986
7008
7029
7050
7072
7093
7115
7136
7158
7179
7200
7222
7243
7265
7286
7308
7329
7350
7372
7393
7415
7436
7458
7479
7501
7522
7543
7565
7586
7608
7629
7651
7672
7693
7715
7736
7758
7779
7801
7822
7843
7865
7886
7908
7929
7951
7972
7993
8015
8036
8058
8079
8101
8122
8143
8165
8186
8208
8229
8251
8272
8293
8315
8336
8358
8379
8401
8422
8443
8465
8486
8508
8529
8551
8572
8593
8615
8636
8658
8679
8701
8722
8743
8765
8786
8808
8829
8851
8872
8893
8915
8936
8958
8979
9001
9022
9043
9065
9086
9108
9129
9151
9172
9193
9215
9236
9258
9279
9301
9322
9343
9365
9386
9408
9429
9451
9472
9493
9515
9536
9558
9579
9601
9622
9644
9665
9686
9708
9729
9751
9772
9794
9815
9836
9858
9879
9901
9922
9944
9965
9986
10008
10029
10051
10072
10094
10115
10136
10158
10179
10201
10222
10244
10265
10286
10308
10329
10351
10372
10394
10415
10436
10458
10479
10501
10522
10544
10565
10586
10608
10629
10651
10672
10694
8795
8813
8830
8848
8865
8883
8901
8918
8936
8953
8971
8988
9006
9024
9041
9059
9076
9094
9112
9129
9147
9164
9182
9200
9217
9235
9252
9270
9288
9305
9323
9340
9358
9375
9393
9411
9428
9446
9463
9481
9499
9516
9534
9551
9569
9587
9604
9622
9639
9657
9675
9692
9710
9727
9745
9762
9780
9798
9815
9833
9850
9868
9886
9903
9921
9938
9956
9974
9991
10009
10026
10044
10061
10079
10097
10114
10132
10149
10167
10185
10202
10220
10237
10255
10273
10290
10308
10325
10343
10361
10378
10396
10413
10431
10448
10466
10484
10501
10519
10536
10554
10572
10589
10607
10624
10642
10660
10677
10695
10712
10730
10747
10765
10783
10800
10818
10835
10853
10871
10888
10906
10923
10941
10959
10976
10994
11011
11029
11047
11064
11082
11099
11117
11134
11152
11170
11187
11205
11222
11240
11258
11275
11293
11310
11328
11346
11363
11381
11398
11416
11434
11451
11469
11486
11504
11521
11539
11557
11574
11592
11609
11627
11645
11662
11680
11697
11715
11733
11750
11768
11785
11803
11820
11838
11856
11873
11891
11908
11926
11944
11961
11979
11996
12014
12032
12049
12067
12084
12102
12120
12137
12155
12172
12190
12207
12225
12243
12260
12278
12295
12313
12331
12348
12366
12383
12401
12419
12436
12454
12471
12489
12506
12524
12542
12559
12577
12594
12612
12630
12647
12665
12682
12700
12718
12735
12753
12770
12788
12806
12823
12841
12858
12876
12893
12911
12929
12946
12964
12981
12999
13017
13034
13052
13069
13087
13105
13122
13140
13157
13175
13193
13210
13228
13245
13263
13280
13298
13316
13333
13351
13368
13386
13404
13421
13439
13456
13474
13492
13509
13527
13544
13562
13579
13597
13615
13632
13650
13667
13685
13703
13720
13738
13755
13773
13791
13808
13826
13843
13861
13879
13896
13914
13931
13949
13966
13984
14002
14019
14037
14054
14072
14090
14107
14125
14142
14160
14178
14195
14213
14230
14248
14265
14283
14301
14318
14336
14353
14371
14389
14406
14424
14441
14459
14477
14494
14512
14529
14547
14565
14582
14600
14617
14635
14652
14670
14688
14705
14723
14740
14758
14776
14793
14811
14828
14846
14864
14881
14899
14916
14934
14952
14969
14987
15004
15022
15039
15057
15075
15092
15110
15127
15145
15163
15180
15198
15215
15233
15251
15268
15286
15303
15321
15338
15356
15374
15391
15409
15426
15444
15462
15479
15497
15514
15532
15550
15567
15585
15602
15620
15638
15655
15673
15690
15708
15725
15743
15761
15778
15796
15813
15831
15849
15866
15884
15901
15919
15937
15954
15972
15989
16007
16024
16042
16060
16077
16095
16112
16130
16148
16165
16183
16200
16218
16236
16253
16271
16288
16306
16324
16341
16359
16376
16394
16411
16429
16447
16464
16482
16499
16517
16535
16552
16570
16587
16605
16623
16640
16658
16675
16693
16711
16728
16746
16763
16781
16798
16816
16834
16851
16869
16886
16904
16922
16939
16957
16974
16992
17010
17027
17045
17062
17080
17097
17115
17133
17150
17168
17185
17203
17221
17238
17256
17273
17291
17309
17326
17344
17361
17379
17397
17414
17432
17449
17467
17484
17502
17520
17537
17555
17572
13900
13914
13928
13942
13956
13970
13983
13997
14011
14025
14039
14053
14067
14081
14095
14109
14122
14136
14150
14164
14178
14192
14206
14220
14234
14248
14261
14275
14289
14303
14317
14331
14345
14359
14373
14387
14400
14414
14428
14442
14456
14470
14484
14498
14512
14526
14539
14553
14567
14581
14595
14609
14623
14637
14651
14665
14678
14692
14706
14720
14734
14748
14762
14776
14790
14804
14817
14831
14845
14859
14873
14887
14901
14915
14929
14943
14956
14970
14984
14998
15012
15026
15040
15054
15068
15082
15095
15109
15123
15137
15151
15165
15179
15193
15207
15221
15234
15248
15262
15276
15290
15304
15318
15332
15346
15360
15373
15387
15401
15415
15429
15443
15457
15471
15485
15499
15512
15526
15540
15554
15568
15582
15596
15610
15624
15638
15651
15665
15679
15693
15707
15721
15735
15749
15763
15777
15790
15804
15818
15832
15846
15860
15874
15888
15902
15916
15929
15943
15957
15971
15985
15999
16013
16027
16041
16055
16068
16082
16096
16110
16124
16138
16152
16166
16180
16194
16207
16221
16235
16249
16263
16277
16291
16305
16319
16333
16346
16360
16374
16388
16402
16416
16430
16444
16458
16472
16485
16499
16513
16527
16541
16555
16569
16583
16597
16611
16624
16638
16652
16666
16680
16694
16708
16722
16736
16750
16763
16777
16791
16805
16819
16833
16847
16861
16875
16889
16902
16916
16930
16944
16958
16972
16986
17000
17014
17028
17041
17055
17069
17083
17097
17111
17125
17139
17153
17167
17180
17194
17208
17222
17236
17250
17264
17278
17292
17306
17319
17333
17347
17361
17375
17389
17403
17417
17431
17445
17458
17472
17486
17500
17514
17528
17542
17556
17570
17584
17597
17611
17625
17639
17653
17667
17681
17695
17709
17723
17736
17750
17764
17778
17792
17806
17820
17834
17848
17862
17875
17889
17903
17917
17931
17945
17959
17973
17987
18001
18014
18028
18042
18056
18070
18084
18098
18112
18126
18140
18153
18167
18181
18195
18209
18223
18237
18251
18265
18279
18292
18306
18320
18334
18348
18362
18376
18390
18404
18418
18431
18445
18459
18473
18487
18501
18515
18529
18543
18557
18570
18584
18598
18612
18626
18640
18654
18668
18682
18696
18709
18723
18737
18751
18765
18779
18793
18807
18821
18835
18848
18862
18876
18890
18904
18918
18932
18946
18960
18974
18987
19001
19015
19029
19043
19057
19071
19085
19099
19113
19126
19140
19154
19168
19182
19196
19210
19224
19238
19252
19265
19279
19293
19307
19321
19335
19349
19363
19377
19391
19404
19418
19432
19446
19460
19474
19488
19502
19516
19530
19543
19557
19571
19585
19599
19613
19627
19641
19655
19669
19682
19696
19710
19724
19738
19752
19766
19780
19794
19808
19821
19835
19849
19863
19877
19891
19905
19919
19933
19947
19960
19974
19988
20002
20016
20030
20044
20058
20072
20086
20099
20113
20127
20141
20155
20169
20183
20197
20211
20225
20238
20252
20266
20280
20294
20308
20322
20336
20350
20364
20377
20391
20405
20419
20433
20447
20461
20475
20489
20503
20516
20530
20544
20558
20572
20586
20600
20614
20628
20642
20655
20669
20683
20697
20711
20725
20739
20753
20767
20781
20794
20808
20822
20836
20850
20864
20878
20892
20906
20920
20933
20947
20961
20975
20989
21003
21017
21031
21045
21059
21072
21086
21100
21114
21128
21142
21156
21170
21184
21198
21211
21225
21239
21253
21267
21281
21295
21309
21323
21337
21350
21364
21378
21392
21406
21420
21434
21448
21462
21476
21489
21503
21517
21531
21545
21559
21573
21587
21601
21615
21628
21642
21656
21670
21684
21698
21712
21726
21740
21754
21767
21781
21795
21809
21823
21837
21851
21865
21879
21893
21906
21920
21934
21948
21962
21976
21990
22004
22018
22032
22045
22059
22073
22087
22101
22115
22129
22143
22157
22171
22184
22198
22212
22226
22240
22254
22268
22282
22296
22310
22323
22337
22351
22365
22379
22393
22407
22421
22435
22449
22462
22476
22490
22504
22518
22532
22546
22560
22574
22588
22601
22615
22629
22643
22657
22671
22685
22699
22713
22727
22740
22754
22768
22782
22796
22810
22824
22838
22852
22866
22879
22893
22907
22921
22935
22949
22963
22977
22991
23005
23018
23032
23046
23060
23074
23088
23102
23116
23130
23144
23157
23171
23185
23199
23213
23227
23241
23255
23269
23283
23296
23310
23324
23338
23352
23366
23380
23394
23408
23422
23435
23449
23463
23477
23491
23505
23519
23533
23547
23561
23574
23588
23602
23616
23630
23644
23658
23672
23686
23700
23713
23727
23741
23755
23769
23783
23797
23811
23825
23839
23852
23866
23880
23894
23908
23922
23936
23950
23964
23978
23991
24005
24019
24033
24047
24061
24075
24089
24103
24117
24130
24144
24158
24172
24186
24200
24214
24228
24242
24256
24269
24283
24297
24311
24325
24339
24353
24367
24381
24395
24408
24422
24436
24450
24464
24478
24492
24506
24520
24534
24547
24561
24575
24589
24603
24617
24631
24645
24659
24673
24686
24700
24714
24728
24742
24756
24770
24784
24798
24812
24825
24839
24853
24867
24881
24895
24909
24923
24937
24951
24964
24978
24992
25006
25020
25034
25048
25062
25076
25090
25103
25117
25131
25145
25159
25173
25187
25201
25215
25229
25242
25256
25270
25284
25298
25312
25326
25340
25354
25368
25381
25395
25409
25423
25437
25451
25465
25479
25493
25507
25520
25534
25548
25562
25576
25590
25604
25618
25632
25646
25659
25673
25687
25701
25715
25729
25743
25757
25771
25785
25798
25812
25826
25840
25854
25868
25882
25896
25910
25924
25937
25951
25965
25979
25993
26007
26021
26035
26049
26063
26076
26090
26104
26118
26132
26146
26160
26174
26188
26202
26215
26229
26243
26257
26271
26285
26299
26313
26327
26341
26354
26368
26382
26396
26410
26424
26438
26452
26466
26480
26493
26507
26521
26535
26549
26563
26577
26591
26605
26619
26632
26646
26660
26674
26688
26702
26716
26730
26744
26758
26771
26785
26799
26813
26827
26841
26855
26869
26883
26897
26910
26924
26938
26952
26966
26980
26994
27008
27022
27036
27049
27063
27077
27091
27105
27119
27133
27147
27161
27175
27188
27202
27216
27230
27244
27258
27272
27286
27300
27314
27327
27341
27355
27369
27383
27397
27411
27425
27439
27453
27466
27480
27494
27508
27522
27536
27550
27564
27578
27592
27605
27619
27633
27647
27661
27675
27689
27703
27717
27731
27744
27758
27772
27786
23740
23752
23764
23776
23787
23799
23811
23823
23835
23847
23859
23871
23882
23894
23906
23918
23930
23942
23954
23966
23977
23989
24001
24013
24025
24037
24049
24060
24072
24084
24096
24108
24120
24132
24144
24155
24167
24179
24191
24203
24215
24227
24239
24250
24262
24274
24286
24298
24310
24322
24334
24345
24357
24369
24381
24393
24405
24417
24428
24440
24452
24464
24476
24488
24500
24512
24523
24535
24547
24559
24571
24583
24595
24607
24618
24630
24642
24654
24666
24678
24690
24701
24713
24725
24737
24749
24761
24773
24785
24796
24808
24820
24832
24844
24856
24868
24880
24891
24903
24915
24927
24939
24951
24963
24974
24986
24998
25010
25022
25034
25046
25058
25069
25081
25093
25105
25117
25129
25141
25153
25164
25176
25188
25200
25212
25224
25236
25247
25259
25271
25283
25295
25307
25319
25331
25342
25354
25366
25378
25390
25402
25414
25426
25437
25449
25461
25473
25485
25497
25509
25521
25532
25544
25556
25568
25580
25592
25604
25615
25627
25639
25651
25663
25675
25687
25699
25710
25722
25734
25746
25758
25770
25782
25794
25805
25817
25829
25841
25853
25865
25877
25888
25900
25912
25924
25936
25948
25960
25972
25983
25995
26007
26019
26031
26043
26055
26067
26078
26090
26102
26114
26126
26138
26150
26161
26173
26185
26197
26209
26221
26233
26245
26256
26268
26280
26292
26304
26316
26328
26340
26351
26363
26375
26387
26399
26411
26423
26434
26446
26458
26470
26482
26494
26506
26518
26529
26541
26553
26565
26577
26589
26601
26613
26624
26636
26648
26660
26672
26684
26696
26708
26719
26731
26743
26755
26767
26779
26791
26802
26814
26826
26838
26850
26862
26874
26886
26897
26909
26921
26933
26945
26957
26969
26981
26992
27004
27016
27028
27040
27052
27064
27075
27087
27099
27111
27123
27135
27147
27159
27170
27182
27194
27206
27218
27230
27242
27254
27265
27277
27289
27301
27313
27325
27337
27348
27360
27372
27384
27396
27408
27420
27432
27443
27455
27467
27479
27491
27503
27515
27527
27538
27550
27562
27574
27586
27598
27610
27621
27633
27645
27657
27669
27681
27693
27705
27716
27728
27740
27752
27764
27776
27788
27800
27811
27823
27835
27847
27859
27871
27883
27895
27906
27918
27930
27942
27954
27966
27978
27989
28001
28013
28025
28037
28049
28061
28073
28084
28096
28108
28120
28132
28144
28156
28168
28179
28191
28203
28215
28227
28239
28251
28262
28274
28286
28298
28310
28322
28334
28346
28357
28369
28381
28393
28405
28417
28429
28441
28452
28464
28476
28488
28500
28512
28524
28535
28547
28559
28571
28583
28595
28607
28619
28630
28642
28654
28666
28678
28690
28702
28714
28725
28737
28749
28761
28773
28785
28797
28808
28820
28832
28844
28856
28868
28880
28892
28903
28915
28927
28939
28951
28963
28975
28987
28998
29010
29022
29034
29046
29058
29070
29082
29093
29105
29117
29129
29141
29153
29165
29176
29188
29200
29212
29224
29236
29248
29260
29271
29283
29295
29307
29319
29331
29343
29355
29366
29378
29390
29402
29414
29426
29438
29449
29461
29473
29485
29497
29509
29521
29533
29544
29556
29568
29580
29592
29604
29616
29628
29639
29651
29663
29675
29687
29699
29711
29722
29734
29746
29758
29770
29782
29794
29806
29817
29829
29841
29853
29865
29877
29889
29901
29912
29924
29936
29948
29960
29972
29984
29995
30007
30019
30031
30043
30055
30067
30079
30090
30102
30114
30126
30138
30150
30162
30174
30185
30197
30209
30221
30233
30245
30257
30269
30280
30292
30304
30316
30328
30340
30352
30363
30375
30387
30399
30411
30423
30435
30447
30458
30470
30482
30494
30506
30518
30530
30542
30553
30565
30577
30589
30601
30613
30625
30636
30648
30660
30672
30684
30696
30708
30720
30731
30743
30755
30767
30779
30791
30803
30815
30826
30838
30850
30862
30874
30886
30898
30909
30921
30933
30945
30957
30969
30981
30993
31004
31016
31028
31040
31052
31064
31076
31088
31099
31111
31123
31135
31147
31159
31171
31182
31194
31206
31218
31230
31242
31254
31266
31277
31289
31301
31313
31325
31337
31349
31361
31372
31384
31396
31408
31420
31432
31444
31456
31467
31479
31491
31503
31515
31527
31539
31550
31562
31574
31586
31598
31610
31622
31634
31645
31657
31669
31681
31693
31705
31717
31729
31740
31752
31764
31776
31788
31800
31812
31823
31835
31847
31859
31871
31883
31895
31907
31918
31930
31942
31954
31966
31978
31990
32002
32013
32025
32037
32049
32061
32073
32085
32096
32108
32120
32132
32144
32156
32168
32180
32191
32203
32215
32227
32239
32251
32263
32275
32286
32298
32310
32322
32334
32346
32358
32369
32381
32393
32405
32417
32429
32441
32453
32464
32476
32488
32500
32512
32524
32536
32548
32559
32571
32583
32595
32607
32619
32631
32643
32654
32666
32678
32690
32702
32714
32726
32737
32749
32761
32773
32785
32797
32809
32821
32832
32844
32856
32868
32880
32892
32904
32916
32927
32939
32951
32963
32975
32987
32999
33010
33022
33034
33046
33058
33070
33082
33094
33105
33117
33129
33141
33153
33165
33177
33189
33200
33212
33224
33236
33248
33260
33272
33283
33295
33307
33319
33331
33343
33355
33367
33378
33390
33402
33414
33426
33438
33450
33462
33473
33485
33497
33509
33521
33533
33545
33556
33568
33580
33592
33604
33616
33628
33640
33651
33663
33675
33687
33699
33711
33723
33735
33746
33758
33770
33782
33794
33806
33818
33830
33841
33853
33865
33877
33889
33901
33913
33924
33936
33948
33960
33972
33984
33996
34008
34019
34031
34043
34055
34067
34079
34091
34103
34114
34126
34138
34150
34162
34174
34186
34197
34209
34221
34233
34245
34257
34269
34281
34292
34304
34316
34328
34340
34352
34364
34376
34387
34399
34411
34423
34435
34447
34459
34470
34482
34494
34506
34518
34530
34542
34554
34565
34577
34589
34601
34613
34625
34637
34649
34660
34672
34684
34696
34708
34720
34732
34743
34755
34767
34779
34791
34803
34815
34827
34838
34850
34862
34874
34886
34898
34910
34922
34933
34945
34957
34969
34981
34993
35005
35017
35028
35040
35052
35064
35076
35088
35100
35111
35123
35135
35147
35159
35171
35183
35195
35206
35218
35230
35242
35254
35266
35278
35290
35301
35313
35325
35337
35349
35361
35373
35384
35396
35408
35420
35432
35444
35456
35468
35479
35491
35503
35515
35527
35539
35551
35563
35574
35586
35598
35610
35622
35634
35646
35657
35669
35681
35693
35705
35717
35729
35741
35752
35764
35776
35788
35800
35812
35824
35836
35847
35859
35871
35883
35895
35907
35919
35930
35942
35954
35966
35978
35990
36002
36014
36025
36037
36049
36061
36073
36085
36097
36109
36120
36132
36144
36156
36168
36180
36192
36204
36215
36227
36239
36251
36263
36275
36287
36298
36310
36322
36334
36346
36358
36370
36382
36393
36405
36417
36429
36441
36453
36465
36477
36488
36500
36512
36524
36536
36548
36560
36571
36583
36595
36607
36619
36631
36643
36655
36666
36678
36690
36702
36714
36726
36738
36750
36761
36773
36785
36797
36809
36821
36833
36844
36856
36868
36880
36892
36904
36916
36928
36939
36951
36963
36975
36987
36999
37011
37023
37034
37046
37058
37070
37082
37094
37106
37117
37129
37141
37153
37165
37177
37189
37201
37212
37224
37236
37248
37260
37272
37284
37296
37307
37319
37331
37343
37355
37367
37379
37391
37402
37414
37426
37438
37450
37462
37474
37485
37497
37509
37521
37533
37545
37557
37569
37580
37592
37604
37616
37628
37640
37652
37664
37675
37687
37699
37711
37723
37735
37747
37758
37770
37782
37794
37806
37818
37830
37842
37853
37865
37877
37889
37901
37913
37925
37937
37948
37960
37972
37984
37996
38008
38020
38031
38043
38055
38067
38079
38091
38103
38115
38126
38138
38150
38162
38174
38186
38198
38210
38221
38233
38245
38257
38269
38281
38293
38304
38316
38328
38340
38352
38364
38376
38388
38399
38411
38423
38435
38447
38459
38471
38483
38494
38506
38518
38530
38542
38554
38566
38578
38589
38601
38613
38625
38637
38649
38661
38672
38684
38696
38708
38720
38732
38744
38756
38767
38779
38791
38803
38815
38827
38839
38851
38862
38874
38886
38898
38910
38922
38934
38945
38957
38969
38981
38993
39005
39017
39029
39040
39052
39064
39076
39088
39100
39112
39124
39135
39147
39159
39171
39183
39195
39207
39218
39230
39242
39254
39266
39278
39290
39302
39313
39325
39337
39349
39361
39373
39385
39397
39408
39420
39432
39444
39456
39468
39480
39491
39503
39515
39527
39539
39551
39563
39575
39586
39598
39610
39622
39634
39646
39658
39670
39681
39693
39705
39717
39729
39741
39753
39765
39776
39788
39800
39812
39824
39836
39848
39859
39871
39883
39895
39907
39919
39931
39943
39954
39966
39978
39990
40002
40014
40026
40038
40049
40061
40073
40085
40097
40109
40121
40132
40144
40156
40168
40180
40192
40204
40216
40227
40239
40251
40263
40275
40287
40299
40311
40322
40334
40346
40358
40370
40382
40394
40405
40417
40429
40441
40453
40465
40477
40489
40500
40512
40524
40536
40548
40560
40572
40584
40595
40607
40619
40631
40643
40655
40667
40678
40690
40702
40714
40726
40738
40750
40762
40773
40785
40797
40809
40821
40833
40845
40857
40868
40880
40892
40904
40916
40928
40940
40952
40963
40975
40987
40999
41011
41023
41035
41046
41058
41070
41082
41094
41106
41118
41130
41141
41153
41165
41177
41189
41201
41213
41225
41236
41248
41260
41272
41284
41296
41308
41319
41331
41343
41355
41367
41379
41391
41403
41414
41426
41438
41450
41462
41474
41486
41498
41509
41521
41533
41545
41557
41569
41581
41592
41604
41616
41628
41640
41652
41664
41676
41687
41699
41711
41723
41735
41747
41759
41771
41782
41794
41806
41818
41830
41842
41854
41865
41877
41889
41901
41913
41925
41937
41949
41960
41972
41984
41996
42008
42020
42032
42044
42055
42067
42079
42091
42103
42115
42127
42139
42150
42162
42174
42186
42198
42210
42222
42233
42245
42257
42269
42281
42293
42305
42317
42328
42340
42352
42364
42376
42388
42400
42412
42423
42435
42447
42459
42471
42483
42495
42506
42518
42530
42542
42554
42566
42578
42590
42601
42613
42625
42637
42649
42661
42673
42685
42696
42708
42720
42732
42744
42756
42768
42779
42791
42803
42815
42827
42839
42851
42863
42874
42886
42898
42910
42922
42934
42946
42958
42969
42981
42993
43005
43017
43029
43041
43052
43064
43076
43088
43100
43112
43124
43136
43147
43159
43171
43183
43195
43207
43219
43231
43242
43254
43266
43278
43290
43302
43314
43326
43337
43349
43361
43373
43385
43397
43409
43420
43432
43444
43456
43468
43480
43492
43504
43515
43527
43539
43551
43563
43575
43587
43599
43610
43622
43634
43646
43658
43670
43682
43693
43705
43717
43729
43741
43753
43765
43777
43788
43800
43812
43824
43836
43848
43860
43872
43883
43895
43907
43919
43931
43943
43955
43966
43978
43990
44002
44014
44026
44038
44050
44061
44073
44085
44097
44109
44121
44133
44145
44156
44168
44180
44192
44204
44216
44228
44239
44251
44263
44275
44287
44299
44311
44323
44334
44346
44358
44370
44382
44394
44406
44418
44429
44441
44453
44465
44477
44489
44501
44513
44524
44536
44548
44560
44572
44584
44596
44607
44619
44631
44643
44655
44667
44679
44691
44702
44714
44726
44738
44750
44762
44774
44786
44797
44809
44821
44833
44845
44857
44869
44880
44892
44904
44916
44928
44940
44952
44964
44975
44987
44999
45011
45023
45035
45047
45059
45070
45082
45094
45106
45118
45130
45142
45153
45165
45177
45189
45201
45213
45225
45237
45248
45260
45272
45284
45296
45308
45320
45332
45343
45355
45367
45379
45391
45403
45415
45426
45438
45450
45462
45474
45486
45498
45510
45521
45533
45545
45557
45569
45581
45593
45605
45616
45628
45640
45652
45664
45676
45688
45700
45711
45723
45735
45747
45759
45771
45783
45794
45806
45818
45830
45842
45854
45866
45878
45889
45901
45913
45925
45937
45949
45961
45973
45984
45996
46008
46020
46032
46044
46056
46067
46079
46091
46103
46115
46127
46139
46151
46162
46174
46186
46198
46210
46222
46234
46246
46257
46269
46281
46293
46305
46317
46329
46340
46352
46364
46376
46388
46400
46412
46424
46435
46447
46459
46471
46483
46495
46507
46519
46530
46542
46554
46566
46578
46590
46602
46613
46625
46637
46649
46661
46673
46685
46697
46708
46720
46732
46744
46756
46768
46780
46792
46803
46815
46827
46839
46851
46863
46875
46887
46898
46910
46922
46934
46946
46958
46970
46981
46993
47005
47017
47029
47041
47053
47065
47076
47088
47100
47112
47124
47136
47148
47160
47171
47183
47195
47207
47219
47231
47243
47254
47266
47278
47290
47302
47314
47326
47338
47349
47361
47373
47385
47397
47409
47421
47433
47444
47456
47468
47480
47492
47504
47516
47527
47539
47551
47563
47575
47587
47599
47611
47622
47634
47646
47658
47670
47682
47694
47706
47717
47729
47741
47753
47765
47777
47789
47800
47812
47824
47836
47848
47860
47872
47884
47895
47907
47919
47931
47943
47955
47967
47979
47990
48002
48014
48026
48038
48050
48062
48074
48085
48097
48109
48121
48133
48145
48157
48168
48180
48192
48204
48216
48228
48240
48252
48263
48275
48287
48299
48311
48323
48335
48347
48358
48370
48382
48394
48406
48418
48430
48441
48453
48465
48477
48489
48501
48513
48525
48536
48548
48560
48572
48584
48596
48608
48620
48631
48643
48655
48667
48679
48691
48703
48714
48726
48738
48750
48762
48774
48786
48798
48809
48821
48833
48845
48857
48869
48881
48893
48904
48916
48928
48940
48952
48964
48976
48987
48999
49011
49023
49035
49047
49059
49071
49082
49094
49106
49118
49130
49142
49154
49166
49177
49189
49201
49213
49225
49237
49249
49261
49272
49284
49296
49308
49320
49332
49344
49355
49367
49379
49391
49403
49415
49427
49439
49450
49462
49474
49486
49498
49510
49522
49534
49545
49557
49569
49581
49593
49605
49617
49628
49640
49652
49664
49676
49688
49700
49712
49723
49735
49747
49759
49771
49783
49795
49807
49818
49830
49842
49854
49866
49878
49890
49901
49913
49925
49937
49949
49961
49973
49985
49996
50008
50020
50032
50044
50056
50068
50080
50091
50103
50115
50127
50139
50151
50163
50174
50186
50198
50210
50222
50234
50246
50258
50269
50281
50293
50305
50317
50329
50341
50353
50364
50376
50388
50400
50412
50424
50436
50448
50459
50471
50483
50495
50507
50519
50531
50542
50554
50566
50578
50590
50602
50614
50626
50637
50649
50661
50673
50685
50697
50709
50721
50732
50744
50756
50768
50780
50792
50804
50815
50827
50839
50851
50863
50875
50887
50899
50910
50922
50934
50946
50958
50970
50982
50994
51005
51017
51029
51041
51053
51065
51077
51088
51100
51112
51124
51136
51148
51160
51172
51183
51195
51207
51219
51231
51243
51255
51267
51278
51290
51302
51314
51326
51338
51350
51361
51373
51385
51397
51409
51421
51433
51445
51456
51468
51480
51492
51504
51516
51528
51540
51551
51563
51575
51587
51599
51611
51623
51635
51646
51658
51670
51682
51694
51706
51718
51729
51741
51753
51765
51777
51789
51801
51813
51824
51836
51848
51860
51872
51884
51896
51908
51919
51931
51943
51955
51967
51979
51991
52002
52014
52026
52038
52050
52062
52074
52086
52097
52109
52121
52133
52145
52157
52169
52181
52192
52204
52216
52228
52240
52252
52264
52275
52287
52299
52311
52323
52335
52347
52359
52370
52382
52394
52406
52418
52430
52442
52454
52465
52477
52489
52501
52513
52525
52537
52548
52560
52572
52584
52596
52608
52620
52632
52643
52655
52667
52679
52691
52703
52715
52727
52738
52750
52762
52774
52786
52798
52810
52822
52833
52845
52857
52869
52881
52893
52905
52916
52928
52940
52952
52964
52976
52988
53000
53011
53023
53035
53047
53059
53071
53083
53095
53106
53118
53130
53142
53154
53166
53178
53189
53201
53213
53225
53237
53249
53261
53273
53284
53296
53308
53320
53332
53344
53356
53368
53379
53391
53403
53415
53427
53439
53451
53462
53474
53486
53498
53510
53522
53534
53546
53557
53569
53581
53593
53605
53617
53629
53641
53652
53664
53676
53688
53700
53712
53724
53735
53747
53759
53771
53783
53795
53807
53819
53830
53842
53854
53866
53878
53890
53902
53914
53925
53937
53949
53961
53973
53985
53997
54009
54020
54032
54044
54056
54068
54080
54092
54103
54115
54127
54139
54151
54163
54175
54187
54198
54210
54222
54234
54246
54258
54270
54282
54293
54305
54317
54329
54341
54353
54365
54376
54388
54400
54412
54424
54436
54448
54460
54471
54483
54495
54507
54519
54531
54543
54555
54566
54578
54590
54602
54614
54626
54638
54649
54661
54673
54685
54697
54709
54721
54733
54744
54756
54768
54780
54792
54804
54816
54828
54839
54851
54863
54875
54887
54899
54911
54922
54934
54946
54958
54970
54982
54994
55006
55017
55029
55041
55053
55065
55077
55089
55101
55112
55124
55136
55148
55160
55172
55184
55196
55207
55219
55231
55243
55255
55267
55279
55290
55302
55314
55326
55338
55350
55362
55374
55385
55397
55409
55421
55433
55445
55457
55469
55480
55492
55504
55516
55528
55540
55552
55563
55575
55587
55599
55611
55623
55635
55647
55658
55670
55682
55694
55706
55718
55730
55742
55753
55765
55777
55789
55801
55813
55825
55836
55848
55860
55872
55884
55896
55908
55920
55931
55943
55955
55967
55979
55991
56003
56015
56026
56038
56050
56062
56074
56086
56098
56109
56121
56133
56145
56157
56169
56181
56193
56204
56216
56228
56240
56252
56264
56276
56288
56299
56311
56323
56335
56347
56359
56371
56383
56394
56406
56418
56430
56442
56454
56466
56477
56489
56501
56513
56525
56537
56549
56561
56572
56584
56596
56608
56620
56632
56644
56656
56667
56679
56691
56703
56715
56727
56739
56750
56762
56774
56786
56798
56810
56822
56834
56845
56857
56869
56881
56893
56905
56917
56929
56940
56952
56964
56976
56988
57000
57012
57023
57035
57047
57059
57071
57083
57095
57107
57118
57130
57142
57154
57166
57178
57190
57202
57213
57225
57237
57249
57261
57273
57285
57296
57308
57320
57332
57344
57356
57368
57380
57391
57403
57415
57427
57439
57451
57463
57475
57486
57498
57510
57522
57534
57546
57558
57570
57581
57593
57605
57617
57629
57641
57653
57664
57676
57688
57700
57712
57724
57736
57748
57759
57771
57783
57795
57807
57819
57831
57843
57854
57866
57878
57890
57902
57914
57926
57937
57949
57961
57973
57985
57997
58009
58021
58032
58044
58056
58068
58080
58092
58104
58116
58127
58139
58151
58163
58175
58187
58199
58210
58222
58234
58246
58258
58270
58282
58294
58305
58317
58329
58341
58353
58365
58377
58389
58400
58412
58424
58436
58448
58460
58472
58483
58495
58507
58519
58531
58543
58555
58567
58578
58590
58602
58614
58626
58638
58650
58662
58673
58685
58697
58709
58721
58733
58745
58757
58768
58780
58792
58804
58816
58828
58840
58851
58863
58875
58887
58899
58911
58923
58935
58946
58958
58970
58982
58994
59006
59018
59030
59041
59053
59065
59077
59089
59101
59113
59124
59136
59148
59160
59172
59184
59196
59208
59219
59231
59243
59255
59267
59279
59291
59303
59314
59326
59338
47050

Thanks in advance,
Donald
 
:) Wow... what I meant when I said a small portion of it was just the first few lines so the code could be stepped through.

Also, I couldn't tell if you posted the answers to the questions that are asked at the beginning of the program (e.g. shipping method, zone, company). What do you type when you run your program and it asks for those things?

Finally, after the first few lines of the input file are read in, what is your expected output? It is easier to do debug things with small input rather than the whole thing.

You may have to start a new thread at some point ... I'm not sure how many people will want to scroll around to find the questions and responses :)
 
I'll start one now.

Thanks in advance,
Donald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top