| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3110 人关注过本帖
标题:怎样从txt中读取数据
只看楼主 加入收藏
vai_ni
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-1-4
结帖率:0
收藏
已结贴  问题点数:10 回复次数:8 
怎样从txt中读取数据
在txt文件中有5组数据,我在C语言编程中,怎样把这五组数据读到程序里去?
搜索更多相关主题的帖子: 编程 C语言 
2013-01-04 16:18
vai_ni
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-1-4
收藏
得分:0 
回复 楼主 vai_ni
这五组数据要按照ASCII码进行排序,要先把文档中的数据弄到程序中,要怎么弄?
2013-01-04 16:20
vai_ni
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2013-1-4
收藏
得分:0 
回复 楼主 vai_ni
900
M200 machine002 280 936 262080
P101 machine003 450 770 346500
Q157 powermac 676 315 212940
J435 powermac 824 5 4120
M200 machine002 280 826 231280
P101 machine003 450 605 272250
Q112 powermac 336 82 27552
P101 machine003 450 145 65250
M200 machine002 280 717 200760
P101 machine003 450 919 413550
B100 machine 100 102 10200
A458 powermac 888 290 257520
F905 powermac 790 909 718110
C881 powermac 48 108 5184
P101 machine003 450 335 150750
B100 machine 100 59 5900
E453 powermac 404 558 225432
I332 powermac 321 418 134178
G200 powerset 150 999 149850
P101 machine003 450 216 97200
Q949 powermac 3 645 1935
K300 power100 300 617 185100
N121 powermac 327 571 186717
H453 powermac 651 423 275373
C037 powermac 463 767 355121
J479 powermac 487 376 183112
P101 machine003 450 408 183600
B100 machine 100 544 54400
N224 powermac 709 424 300616
F559 powermac 350 358 125300
M200 machine002 280 690 193200
J336 powermac 708 61 43188
E031 powermac 681 638 434478
N257 powermac 201 161 32361
K300 power100 300 831 249300
Q946 powermac 689 144 99216
G200 powerset 150 143 21450
L299 powermac 893 901 804593
R712 powermac 285 452 128820
B100 machine 100 210 21000
K300 power100 300 344 103200
G200 powerset 150 139 20850
F339 powermac 420 753 316260
J561 powermac 330 703 231990
F870 powermac 70 847 59290
C897 powermac 513 750 384750
C553 powermac 437 119 52003
M200 machine002 280 860 240800
F711 powermac 993 449 445857
L573 powermac 774 941 728334
M200 machine002 280 632 176960
O066 powermac 495 747 369765
G200 powerset 150 749 112350
H969 powermac 682 663 452166
K300 power100 300 438 131400
H204 powermac 24 878 21072
D096 powermac 988 213 210444
B100 machine 100 437 43700
K300 power100 300 825 247500
H113 powermac 759 79 59961
B100 machine 100 800 80000
J445 powermac 40 92 3680
P101 machine003 450 106 47700
J767 powermac 740 400 296000
P101 machine003 450 699 314550
H428 powermac 135 293 39555
A545 powermac 69 46 3174
G200 powerset 150 319 47850
O575 powermac 941 221 207961
M200 machine002 280 893 250040
E879 powermac 838 188 157544
G200 powerset 150 351 52650
F752 powermac 922 819 755118
H152 powermac 244 744 181536
B100 machine 100 468 46800
B100 machine 100 950 95000
D507 powermac 141 342 48222
H520 powermac 644 971 625324
M200 machine002 280 182 50960
F447 powermac 428 616 263648
L289 powermac 636 802 510072
P101 machine003 450 400 180000
J850 powermac 643 321 206403
B100 machine 100 145 14500
M200 machine002 280 300 84000
L057 powermac 998 597 595806
B100 machine 100 650 65000
J876 powermac 781 416 324896
P101 machine003 450 532 239400
J253 powermac 13 20 260
C079 powermac 703 686 482258
H673 powermac 222 904 200688
B100 machine 100 206 20600
G200 powerset 150 71 10650
P101 machine003 450 845 380250
C664 powermac 288 691 199008
G200 powerset 150 559 83850
E975 powermac 110 519 57090
J579 powermac 9 547 4923
P101 machine003 450 16 7200
E688 powermac 502 829 416158
H832 powermac 965 277 267305
P101 machine003 450 5 2250
K300 power100 300 433 129900
M200 machine002 280 871 243880
G200 powerset 150 938 140700
B100 machine 100 761 76100
R656 powermac 128 478 61184
B100 machine 100 565 56500
M200 machine002 280 973 272440
P101 machine003 450 63 28350
I190 powermac 694 400 277600
H758 powermac 877 946 829642
J078 powermac 463 929 430127
H198 powermac 601 764 459164
E473 powermac 180 744 133920
P101 machine003 450 252 113400
A187 powermac 946 975 922350
I665 powermac 230 812 186760
A236 powermac 711 768 546048
M200 machine002 280 213 59640
L255 powermac 386 919 354734
B100 machine 100 894 89400
M200 machine002 280 230 64400
G200 powerset 150 227 34050
B100 machine 100 945 94500
G200 powerset 150 100 15000
L581 powermac 623 386 240478
M200 machine002 280 14 3920
P101 machine003 450 899 404550
P101 machine003 450 469 211050
P101 machine003 450 849 382050
I424 powermac 370 275 101750
R709 powermac 990 177 175230
E751 powermac 710 990 702900
R670 powermac 274 423 115902
H919 powermac 671 159 106689
A293 powermac 346 10 3460
E919 powermac 1 559 559
R621 powermac 983 82 80606
K300 power100 300 494 148200
A627 powermac 51 808 41208
I559 powermac 776 5 3880
F789 powermac 266 251 66766
P101 machine003 450 546 245700
A484 powermac 233 247 57551
C759 powermac 667 346 230782
M200 machine002 280 442 123760
F246 powermac 7 508 3556
G200 powerset 150 430 64500
I172 powermac 681 421 286701
H379 powermac 716 98 70168
B100 machine 100 530 53000
B100 machine 100 843 84300
M200 machine002 280 962 269360
P101 machine003 450 28 12600
G200 powerset 150 563 84450
C787 powermac 354 91 32214
P101 machine003 450 150 67500
B100 machine 100 659 65900
H109 powermac 678 158 107124
G200 powerset 150 989 148350
K300 power100 300 406 121800
A688 powermac 321 553 177513
G200 powerset 150 392 58800
R833 powermac 374 670 250580
O338 powermac 816 106 86496
R534 powermac 412 544 224128
B100 machine 100 611 61100
N986 powermac 918 132 121176
B100 machine 100 685 68500
R135 powermac 840 742 623280
G200 powerset 150 646 96900
G200 powerset 150 380 57000
L852 powermac 109 801 87309
B100 machine 100 194 19400
K300 power100 300 518 155400
B100 machine 100 704 70400
B100 machine 100 30 3000
F734 powermac 495 359 177705
E121 powermac 524 958 501992
K300 power100 300 839 251700
G200 powerset 150 831 124650
K300 power100 300 67 20100
D820 powermac 240 408 97920
K300 power100 300 327 98100
P101 machine003 450 81 36450
Q481 powermac 531 418 221958
M200 machine002 280 696 194880
O756 powermac 241 916 220756
F300 powermac 920 895 823400
K300 power100 300 64 19200
H675 powermac 494 302 149188
Q476 powermac 765 125 95625
K300 power100 300 103 30900
G200 powerset 150 479 71850
G200 powerset 150 496 74400
K300 power100 300 169 50700
Q644 powermac 548 300 164400
H521 powermac 686 733 502838
H370 powermac 336 529 177744
B100 machine 100 954 95400
P101 machine003 450 756 340200
G200 powerset 150 560 84000
G200 powerset 150 10 1500
P101 machine003 450 777 349650
M200 machine002 280 568 159040
E839 powermac 240 200 48000
C829 powermac 649 532 345268
F528 powermac 713 916 653108
M200 machine002 280 898 251440
N791 powermac 229 419 95951
G200 powerset 150 259 38850
P101 machine003 450 912 410400
B100 machine 100 748 74800
P101 machine003 450 8 3600
P101 machine003 450 790 355500
I218 powermac 63 849 53487
N156 powermac 425 943 400775
R445 powermac 753 241 181473
G200 powerset 150 133 19950
B100 machine 100 929 92900
M200 machine002 280 875 245000
R178 powermac 321 263 84423
D188 powermac 65 647 42055
O780 powermac 275 439 120725
G200 powerset 150 975 146250
K300 power100 300 1000 300000
O634 powermac 861 9 7749
B100 machine 100 562 56200
M200 machine002 280 575 161000
M200 machine002 280 468 131040
K300 power100 300 103 30900
C903 powermac 986 145 142970
K300 power100 300 236 70800
I015 powermac 383 791 302953
G200 powerset 150 841 126150
K300 power100 300 7 2100
K300 power100 300 333 99900
P101 machine003 450 882 396900
I189 powermac 774 57 44118
K300 power100 300 232 69600
E275 powermac 824 670 552080
M200 machine002 280 103 28840
J382 powermac 565 997 563305
L075 powermac 874 562 491188
O978 powermac 20 959 19180
N509 powermac 83 886 73538
D531 powermac 873 351 306423
B100 machine 100 751 75100
P101 machine003 450 32 14400
G200 powerset 150 328 49200
G200 powerset 150 482 72300
C241 powermac 921 989 910869
I078 powermac 408 669 272952
D156 powermac 353 455 160615
Q007 powermac 458 490 224420
C654 powermac 709 68 48212
J755 powermac 284 147 41748
J120 powermac 748 858 641784
P101 machine003 450 807 363150
M200 machine002 280 409 114520
M200 machine002 280 310 86800
H919 powermac 671 250 167750
J761 powermac 146 966 141036
I044 powermac 882 609 537138
P101 machine003 450 641 288450
E785 powermac 475 146 69350
B100 machine 100 778 77800
J878 powermac 237 724 171588
D429 powermac 812 964 782768
K300 power100 300 447 134100
G200 powerset 150 332 49800
C385 powermac 880 125 110000
D263 powermac 333 485 161505
M200 machine002 280 578 161840
M200 machine002 280 855 239400
B100 machine 100 790 79000
O855 powermac 57 40 2280
M200 machine002 280 966 270480
K300 power100 300 537 161100
P101 machine003 450 113 50850
F519 powermac 971 370 359270
B100 machine 100 557 55700
J763 powermac 237 906 214722
F715 powermac 963 272 261936
G200 powerset 150 883 132450
F902 powermac 447 183 81801
B100 machine 100 524 52400
P101 machine003 450 148 66600
O212 powermac 597 434 259098
C532 powermac 230 185 42550
J399 powermac 977 327 319479
I462 powermac 925 939 868575
J621 powermac 118 963 113634
M200 machine002 280 572 160160
D325 powermac 573 802 459546
N139 powermac 909 441 400869
J865 powermac 599 438 262362
G200 powerset 150 830 124500
P101 machine003 450 135 60750
A636 powermac 41 911 37351
J103 powermac 242 499 120758
M200 machine002 280 262 73360
K300 power100 300 135 40500
P101 machine003 450 649 292050
H821 powermac 586 283 165838
F662 powermac 744 725 539400
G200 powerset 150 952 142800
M200 machine002 280 448 125440
H334 powermac 926 10 9260
C450 powermac 84 649 54516
G200 powerset 150 754 113100
M200 machine002 280 210 58800
C197 powermac 332 470 156040
M200 machine002 280 611 171080
P101 machine003 450 939 422550
G200 powerset 150 482 72300
G200 powerset 150 729 109350
P101 machine003 450 237 106650
M200 machine002 280 649 181720
M200 machine002 280 439 122920
A665 powermac 155 944 146320
C004 powermac 17 91 1547
B100 machine 100 565 56500
P101 machine003 450 765 344250
C758 powermac 652 38 24776
F875 powermac 425 16 6800
M200 machine002 280 245 68600
R250 powermac 497 860 427420
F245 powermac 681 572 389532
D082 powermac 828 56 46368
I780 powermac 289 5 1445
P101 machine003 450 389 175050
F285 powermac 545 702 382590
D321 powermac 835 11 9185
H215 powermac 963 520 500760
Q263 powermac 486 613 297918
E677 powermac 101 456 46056
E543 powermac 978 404 395112
M200 machine002 280 67 18760
P101 machine003 450 551 247950
D886 powermac 689 892 614588
K300 power100 300 749 224700
M200 machine002 280 898 251440
H609 powermac 947 951 900597
K300 power100 300 605 181500
E937 powermac 872 66 57552
K300 power100 300 870 261000
F338 powermac 226 382 86332
B100 machine 100 296 29600
B100 machine 100 192 19200
Q465 powermac 782 431 337042
P101 machine003 450 220 99000
M200 machine002 280 874 244720
B100 machine 100 884 88400
K300 power100 300 431 129300
D481 powermac 832 901 749632
I786 powermac 104 741 77064
B100 machine 100 391 39100
G200 powerset 150 532 79800
B100 machine 100 869 86900
G200 powerset 150 382 57300
A381 powermac 84 797 66948
F089 powermac 473 981 464013
G200 powerset 150 616 92400
B100 machine 100 161 16100
G200 powerset 150 740 111000
F832 powermac 444 796 353424
H701 powermac 822 297 244134
F674 powermac 844 279 235476
I839 powermac 243 616 149688
P101 machine003 450 981 441450
G200 powerset 150 895 134250
H041 powermac 539 977 526603
F629 powermac 863 759 655017
K300 power100 300 243 72900
D927 powermac 112 344 38528
L988 powermac 416 581 241696
M200 machine002 280 295 82600
P101 machine003 450 175 78750
G200 powerset 150 632 94800
P101 machine003 450 551 247950
C352 powermac 688 154 105952
G200 powerset 150 391 58650
M200 machine002 280 270 75600
R784 powermac 268 891 238788
B100 machine 100 884 88400
O108 powermac 685 378 258930
G200 powerset 150 116 17400
B100 machine 100 434 43400
M200 machine002 280 614 171920
R357 powermac 149 593 88357
O593 powermac 475 200 95000
N505 powermac 246 370 91020
B100 machine 100 785 78500
Q068 powermac 547 619 338593
G200 powerset 150 504 75600
R533 powermac 830 509 422470
C643 powermac 140 936 131040
I282 powermac 72 407 29304
K300 power100 300 834 250200
C356 powermac 33 980 32340
G200 powerset 150 187 28050
N372 powermac 392 685 268520
B100 machine 100 605 60500
D563 powermac 23 437 10051
F172 powermac 20 796 15920
J998 powermac 881 166 146246
Q387 powermac 614 37 22718
Q923 powermac 114 822 93708
P101 machine003 450 893 401850
K300 power100 300 625 187500
K300 power100 300 696 208800
Q074 powermac 781 583 455323
O466 powermac 794 574 455756
P101 machine003 450 148 66600
O579 powermac 648 855 554040
P101 machine003 450 149 67050
G200 powerset 150 357 53550
A965 powermac 850 777 660450
G200 powerset 150 433 64950
L441 powermac 767 506 388102
K300 power100 300 961 288300
B100 machine 100 856 85600
A546 powermac 146 215 31390
I614 powermac 974 978 952572
R729 powermac 943 932 878876
G200 powerset 150 953 142950
B100 machine 100 301 30100
F574 powermac 822 458 376476
N002 powermac 920 833 766360
P101 machine003 450 303 136350
H804 powermac 775 10 7750
D176 powermac 111 802 89022
G200 powerset 150 1 150
C282 powermac 60 612 36720
L461 powermac 582 379 220578
E051 powermac 178 566 100748
J970 powermac 521 835 435035
G200 powerset 150 750 112500
D672 powermac 367 784 287728
M200 machine002 280 137 38360
M200 machine002 280 492 137760
D720 powermac 715 506 361790
R712 powermac 285 899 256215
K300 power100 300 494 148200
L556 powermac 383 430 164690
P101 machine003 450 85 38250
M200 machine002 280 783 219240
L552 powermac 488 879 428952
E766 powermac 134 800 107200
M200 machine002 280 245 68600
I345 powermac 143 231 33033
I752 powermac 334 879 293586
K300 power100 300 240 72000
B100 machine 100 649 64900
H575 powermac 53 984 52152
K300 power100 300 763 228900
K300 power100 300 849 254700
H538 powermac 49 560 27440
P101 machine003 450 137 61650
I539 powermac 405 712 288360
L686 powermac 446 872 388912
G200 powerset 150 296 44400
O854 powermac 52 810 42120
Q349 powermac 860 414 356040
M200 machine002 280 198 55440
D691 powermac 212 69 14628
I115 powermac 278 37 10286
O733 powermac 714 901 643314
G200 powerset 150 410 61500
M200 machine002 280 178 49840
G200 powerset 150 82 12300
L162 powermac 180 384 69120
O072 powermac 898 725 651050
Q898 powermac 632 127 80264
R872 powermac 522 463 241686
B100 machine 100 824 82400
N630 powermac 945 45 42525
B100 machine 100 6 600
I164 powermac 332 700 232400
F344 powermac 512 974 498688
J043 powermac 220 541 119020
B100 machine 100 117 11700
H181 powermac 999 139 138861
H163 powermac 978 869 849882
M200 machine002 280 488 136640
M200 machine002 280 372 104160
B100 machine 100 842 84200
J005 powermac 955 965 921575
A678 powermac 959 803 770077
M200 machine002 280 544 152320
M200 machine002 280 891 249480
K300 power100 300 231 69300
K300 power100 300 186 55800
M200 machine002 280 283 79240
D151 powermac 970 6 5820
D401 powermac 167 483 80661
R565 powermac 611 672 410592
O900 powermac 855 922 788310
O859 powermac 531 734 389754
J735 powermac 583 816 475728
O775 powermac 626 564 353064
M200 machine002 280 345 96600
P101 machine003 450 278 125100
H533 powermac 906 74 67044
G200 powerset 150 506 75900
K300 power100 300 536 160800
K300 power100 300 164 49200
P101 machine003 450 617 277650
K300 power100 300 53 15900
P101 machine003 450 164 73800
B100 machine 100 719 71900
F489 powermac 256 125 32000
F770 powermac 313 646 202198
Q278 powermac 320 947 303040
M200 machine002 280 333 93240
F954 powermac 820 545 446900
O250 powermac 405 95 38475
G200 powerset 150 928 139200
O463 powermac 630 510 321300
K300 power100 300 588 176400
H787 powermac 966 288 278208
P101 machine003 450 314 141300
L429 powermac 769 869 668261
P101 machine003 450 216 97200
M200 machine002 280 846 236880
L343 powermac 725 454 329150
D169 powermac 651 890 579390
R277 powermac 249 414 103086
B100 machine 100 663 66300
L462 powermac 539 14 7546
E866 powermac 190 879 167010
K300 power100 300 76 22800
N574 powermac 505 744 375720
J986 powermac 750 66 49500
P101 machine003 450 458 206100
P101 machine003 450 472 212400
K300 power100 300 145 43500
K300 power100 300 49 14700
Q636 powermac 309 46 14214
R351 powermac 820 237 194340
M200 machine002 280 707 197960
K300 power100 300 701 210300
P101 machine003 450 317 142650
P101 machine003 450 758 341100
D992 powermac 477 548 261396
M200 machine002 280 835 233800
J686 powermac 51 394 20094
B100 machine 100 4 400
O480 powermac 207 649 134343
L222 powermac 65 182 11830
G200 powerset 150 264 39600
H565 powermac 110 185 20350
N338 powermac 295 831 245145
P101 machine003 450 216 97200
J832 powermac 356 208 74048
K300 power100 300 354 106200
G200 powerset 150 105 15750
A157 powermac 330 248 81840
G200 powerset 150 560 84000
M200 machine002 280 118 33040
K300 power100 300 212 63600
C406 powermac 643 9 5787
G200 powerset 150 478 71700
C291 powermac 949 61 57889
F594 powermac 125 892 111500
G200 powerset 150 110 16500
K300 power100 300 282 84600
I393 powermac 600 630 378000
J202 powermac 730 949 692770
B100 machine 100 183 18300
D239 powermac 338 121 40898
J532 powermac 223 750 167250
M200 machine002 280 239 66920
K300 power100 300 465 139500
F220 powermac 844 958 808552
O218 powermac 488 604 294752
J439 powermac 4 773 3092
A000 powermac 544 928 504832
B100 machine 100 864 86400
A642 powermac 813 479 389427
P101 machine003 450 425 191250
E776 powermac 196 333 65268
B100 machine 100 927 92700
R499 powermac 720 379 272880
G200 powerset 150 923 138450
Q324 powermac 233 996 232068
J439 powermac 4 476 1904
D413 powermac 674 884 595816
F172 powermac 20 396 7920
A871 powermac 159 334 53106
H754 powermac 308 489 150612
L618 powermac 393 85 33405
H511 powermac 17 404 6868
C506 powermac 668 784 523712
K300 power100 300 602 180600
F983 powermac 244 982 239608
P101 machine003 450 829 373050
K300 power100 300 319 95700
K300 power100 300 868 260400
R824 powermac 40 921 36840
R471 powermac 108 166 17928
F508 powermac 97 590 57230
Q754 powermac 767 733 562211
G200 powerset 150 559 83850
H921 powermac 539 961 517979
P101 machine003 450 97 43650
G200 powerset 150 531 79650
M200 machine002 280 687 192360
E317 powermac 181 11 1991
I616 powermac 395 940 371300
B100 machine 100 353 35300
C230 powermac 890 827 736030
F154 powermac 886 769 681334
A884 powermac 632 518 327376
B100 machine 100 956 95600
G200 powerset 150 930 139500
K300 power100 300 88 26400
D610 powermac 931 927 863037
P101 machine003 450 911 409950
G200 powerset 150 944 141600
G200 powerset 150 355 53250
P101 machine003 450 808 363600
B100 machine 100 643 64300
E312 powermac 533 902 480766
G200 powerset 150 793 118950
H896 powermac 670 946 633820
B100 machine 100 835 83500
K300 power100 300 43 12900
O339 powermac 980 933 914340
M200 machine002 280 867 242760
F737 powermac 477 117 55809
B100 machine 100 22 2200
K300 power100 300 350 105000
M200 machine002 280 851 238280
P101 machine003 450 263 118350
M200 machine002 280 835 233800
D813 powermac 111 976 108336
M200 machine002 280 306 85680
J709 powermac 148 138 20424
G200 powerset 150 174 26100
H909 powermac 968 256 247808
P101 machine003 450 845 380250
D428 powermac 489 822 401958
C793 powermac 179 985 176315
K300 power100 300 157 47100
D845 powermac 672 933 626976
B100 machine 100 70 7000
P101 machine003 450 750 337500
I082 powermac 187 396 74052
B100 machine 100 329 32900
M200 machine002 280 106 29680
H079 powermac 915 81 74115
P101 machine003 450 206 92700
E182 powermac 964 691 666124
D552 powermac 687 410 281670
B100 machine 100 189 18900
G200 powerset 150 112 16800
G200 powerset 150 810 121500
A572 powermac 820 582 477240
C357 powermac 988 38 37544
Q545 powermac 718 335 240530
K300 power100 300 976 292800
F888 powermac 476 344 163744
K300 power100 300 196 58800
K300 power100 300 578 173400
M200 machine002 280 432 120960
K300 power100 300 102 30600
K300 power100 300 647 194100
F054 powermac 946 294 278124
N926 powermac 69 682 47058
M200 machine002 280 188 52640
M200 machine002 280 369 103320
G200 powerset 150 880 132000
H297 powermac 403 115 46345
J836 powermac 382 798 304836
A213 powermac 11 893 9823
E068 powermac 324 587 190188
G200 powerset 150 488 73200
P101 machine003 450 248 111600
H536 powermac 591 342 202122
B100 machine 100 814 81400
F883 powermac 510 366 186660
C504 powermac 124 124 15376
C874 powermac 376 134 50384
J334 powermac 208 299 62192
G200 powerset 150 460 69000
D035 powermac 722 583 420926
P101 machine003 450 868 390600
J345 powermac 758 434 328972
H018 powermac 337 805 271285
P101 machine003 450 878 395100
H347 powermac 790 584 461360
M200 machine002 280 184 51520
H318 powermac 326 618 201468
K300 power100 300 381 114300
M200 machine002 280 823 230440
P101 machine003 450 668 300600
J392 powermac 249 893 222357
A899 powermac 743 256 190208
E247 powermac 57 657 37449
O958 powermac 189 907 171423
C436 powermac 732 692 506544
E938 powermac 506 96 48576
F638 powermac 143 137 19591
F795 powermac 678 64 43392
L123 powermac 309 757 233913
B100 machine 100 7 700
G200 powerset 150 754 113100
G200 powerset 150 953 142950
K300 power100 300 944 283200
K300 power100 300 229 68700
B100 machine 100 283 28300
K300 power100 300 668 200400
L231 powermac 837 84 70308
B100 machine 100 700 70000
G200 powerset 150 134 20100
B100 machine 100 151 15100
B100 machine 100 390 39000
F626 powermac 438 25 10950
I134 powermac 930 552 513360
M200 machine002 280 747 209160
G200 powerset 150 792 118800
F055 powermac 772 432 333504
C807 powermac 871 364 317044
P101 machine003 450 984 442800
J657 powermac 373 753 280869
H336 powermac 780 393 306540
G200 powerset 150 920 138000
N326 powermac 174 988 171912
R402 powermac 303 200 60600
C913 powermac 930 599 557070
M200 machine002 280 812 227360
P101 machine003 450 536 241200
N077 powermac 628 836 525008
M200 machine002 280 770 215600
F030 powermac 116 730 84680
P101 machine003 450 523 235350
B100 machine 100 63 6300
E529 powermac 332 79 26228
E578 powermac 390 806 314340
H370 powermac 336 227 76272
B100 machine 100 271 27100
L408 powermac 868 280 243040
K300 power100 300 882 264600
B100 machine 100 761 76100
F027 powermac 997 759 756723
B100 machine 100 856 85600
N389 powermac 346 307 106222
G200 powerset 150 354 53100
M200 machine002 280 587 164360
G200 powerset 150 703 105450
H067 powermac 843 905 762915
E538 powermac 129 923 119067
N245 powermac 274 709 194266
I790 powermac 250 715 178750
P101 machine003 450 851 382950
K300 power100 300 578 173400
P101 machine003 450 43 19350
J344 powermac 147 595 87465
B100 machine 100 517 51700
K300 power100 300 149 44700
H787 powermac 966 245 236670
C201 powermac 176 477 83952
G200 powerset 150 814 122100
C450 powermac 84 727 61068
C370 powermac 896 747 669312
Q259 powermac 858 549 471042
F566 powermac 672 65 43680
K300 power100 300 418 125400
R787 powermac 421 961 404581
R424 powermac 82 127 10414
O420 powermac 782 547 427754
B100 machine 100 297 29700
B100 machine 100 526 52600
B100 machine 100 653 65300
J739 powermac 421 384 161664
H313 powermac 435 553 240555
P101 machine003 450 912 410400
E229 powermac 450 712 320400
G200 powerset 150 581 87150
K300 power100 300 973 291900
H496 powermac 758 646 489668
N195 powermac 113 67 7571
I534 powermac 151 277 41827
N454 powermac 626 152 95152
R475 powermac 811 299 242489
P101 machine003 450 959 431550
A875 powermac 578 556 321368
B100 machine 100 500 50000
Q458 powermac 879 928 815712
R012 powermac 212 637 135044
M200 machine002 280 787 220360
B100 machine 100 37 3700
F523 powermac 799 988 789412
B100 machine 100 569 56900
N802 powermac 698 928 647744
L800 powermac 887 684 606708
P101 machine003 450 324 145800
F403 powermac 327 387 126549
C421 powermac 360 335 120600
L774 powermac 62 205 12710
M200 machine002 280 153 42840
M200 machine002 280 724 202720
D614 powermac 57 346 19722
N130 powermac 199 210 41790
G200 powerset 150 350 52500
G200 powerset 150 731 109650
K300 power100 300 365 109500
P101 machine003 450 334 150300
D072 powermac 374 306 114444
F177 powermac 964 997 961108
E220 powermac 261 325 84825
M200 machine002 280 584 163520
N644 powermac 497 975 484575
K300 power100 300 361 108300
B100 machine 100 417 41700
K300 power100 300 539 161700
N287 powermac 276 216 59616
F945 powermac 845 543 458835
O912 powermac 132 809 106788
N716 powermac 629 217 136493
E875 powermac 109 340 37060
K300 power100 300 874 262200
B100 machine 100 172 17200
H869 powermac 660 718 473880
M200 machine002 280 403 112840
M200 machine002 280 47 13160
R586 powermac 552 461 254472
E717 powermac 719 294 211386
E401 powermac 714 546 389844
P101 machine003 450 539 242550
K300 power100 300 483 144900
B100 machine 100 434 43400
D079 powermac 526 578 304028
P101 machine003 450 873 392850
G200 powerset 150 978 146700
Q909 powermac 803 229 183887
E839 powermac 240 420 100800
B100 machine 100 557 55700
K300 power100 300 287 86100
M200 machine002 280 74 20720
G200 powerset 150 202 30300
D030 powermac 64 544 34816
D653 powermac 751 2 1502
P101 machine003 450 246 110700
J542 powermac 609 953 580377
B100 machine 100 783 78300
K300 power100 300 136 40800
E581 powermac 303 17 5151
Q646 powermac 500 245 122500
B100 machine 100 199 19900
A531 powermac 84 135 11340
K300 power100 300 907 272100
G200 powerset 150 802 120300
P101 machine003 450 667 300150
J442 powermac 901 870 783870
B100 machine 100 250 25000
D474 powermac 698 822 573756
M200 machine002 280 590 165200
E785 powermac 475 919 436525
P101 machine003 450 418 188100
I944 powermac 183 618 113094
M200 machine002 280 581 162680
B100 machine 100 36 3600
K300 power100 300 19 5700
K300 power100 300 676 202800
O264 powermac 82 127 10414
H114 powermac 271 26 7046
P101 machine003 450 347 156150
B100 machine 100 581 58100
B100 machine 100 703 70300
K300 power100 300 112 33600
B100 machine 100 93 9300
R535 powermac 786 589 462954
P101 machine003 450 950 427500
M200 machine002 280 477 133560
A482 powermac 817 237 193629
M200 machine002 280 952 266560
H335 powermac 843 540 455220
M200 machine002 280 408 114240
P101 machine003 450 45 20250
R718 powermac 891 254 226314
K300 power100 300 318 95400
E040 powermac 768 957 734976
Q352 powermac 89 565 50285
O083 powermac 111 513 56943
B100 machine 100 772 77200
N294 powermac 405 418 169290
D368 powermac 958 310 296980
H826 powermac 757 945 715365
G200 powerset 150 722 108300
P101 machine003 450 360 162000
M200 machine002 280 785 219800
L855 powermac 128 666 85248
K300 power100 300 392 117600
K300 power100 300 652 195600
E246 powermac 874 399 348726
第一行是这组数据的总个数  第一列是ASCII码 第二列是名称 第三列是单价 第四列是数量 第五列是总金额 要求按照ASCII码进行排序,若ASCII码相同则按总金额从大到小排序。

2013-01-04 16:30
傻傻的聪明鬼
Rank: 1
来 自:上海
等 级:等待验证会员
帖 子:8
专家分:8
注 册:2011-4-14
收藏
得分:2 
C里面 用链表应该不难吧
C++ 的话,getline()和stringstream()也行,我基本思路是这样的,我也才学一点点

不要低估一颗菜鸟的心
2013-01-06 15:40
mmmmmmmmmmmm
Rank: 10Rank: 10Rank: 10
等 级:青峰侠
威 望:8
帖 子:388
专家分:1809
注 册:2012-11-2
收藏
得分:2 
fstream

我们的目标只有一个:消灭0回复!
while(1)
++money;
2013-01-06 15:46
conan8732
Rank: 2
等 级:论坛游民
帖 子:24
专家分:43
注 册:2012-8-8
收藏
得分:2 
struct stu
{

}
stu a[100];
FILE *fp;
fopen();
fread(a,sizeof(stu),90,fp);
2013-01-10 14:11
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册:2011-1-18
收藏
得分:2 
我在C语言编程中
------ 到底是C还是C++?如果要C,应该发在C论坛
2013-01-10 14:23
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册:2011-1-18
收藏
得分:0 
回复 3楼 vai_ni
这个文档格式设计者应该去吃屎
首先是第一行的数量根本没必要,因为实际行数是可以统计出来的,这样的设计除了增加错误之外,毫无用处;
其次是总价,可以根据单价和数量计算出,理由同上。
另外,题目描述要清楚,不能让别人去瞎猜,比如文中所谓的“ASCII码”是不是严格4个字节长度,不能多也不能少,是不是还允许空格等字符存在?你都没有交代;再比如“单价”是不是只允许整数,数值上限是多少?

假如用C++,我写个DEMO
程序代码:
#include <string>

struct foo
{
    std::string id;
    std::string name;
    unsigned unitprice;
    unsigned quantity;
    unsigned totalprice;
};

bool foo_cmp( const foo& lhs, const foo& rhs )
{
    if( lhs.id == rhs.id )
        return lhs.totalprice > rhs.totalprice;
    return lhs.id < rhs.id;
}

#include <iostream>

std::istream& operator>>( std::istream& in, foo& rhs )
{
    return in >> rhs.id >> rhs.name >> rhs.unitprice >> rhs.quantity >> rhs.totalprice;
}
std::ostream& operator<<( std::ostream& out, foo& rhs )
{
    return out << rhs.id << ' '<< rhs.name << ' '<< rhs.unitprice << ' '<< rhs.quantity << ' '<< rhs.totalprice;
}

#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    ifstream file( "fuck.txt" );
    if( !file )
        return 1;

    size_t n;
    if( !(file>>n) )
        return 2;

    vector<foo> buf( n );
    for( size_t i=0; i<buf.size(); ++i )
        file >> buf[i];

    sort( buf.begin(), buf.end(), &foo_cmp );

    ofstream fileout( "cao.txt" );
    if( !fileout )
        return 3;

    fileout << buf.size() << '\n';

    for( size_t i=0; i<buf.size(); ++i )
        fileout << buf[i] << '\n';

    return 0;
}

2013-01-10 14:57
我爱下载102
Rank: 2
等 级:论坛游民
帖 子:15
专家分:10
注 册:2013-1-5
收藏
得分:2 
回复 8楼 rjsp
你是高手哦
2013-01-10 22:51
快速回复:怎样从txt中读取数据
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017563 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved