fork download
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
  100. 100
  101. 101
  102. 102
  103. 103
  104. 104
  105. 105
  106. 106
  107. 107
  108. 108
  109. 109
  110. 110
  111. 111
  112. 112
  113. 113
  114. 114
  115. 115
  116. 116
  117. 117
  118. 118
  119. 119
  120. 120
  121. 121
  122. 122
  123. 123
  124. 124
  125. 125
  126. 126
  127. 127
  128. 128
  129. 129
  130. 130
  131. 131
  132. 132
  133. 133
  134. 134
  135. 135
  136. 136
  137. 137
  138. 138
  139. 139
  140. 140
  141. 141
  142. 142
  143. 143
  144. 144
  145. 145
  146. 146
  147. 147
  148. 148
  149. 149
  150. 150
  151. 151
  152. 152
  153. 153
  154. 154
  155. 155
  156. 156
  157. 157
  158. 158
  159. 159
  160. 160
  161. 161
  162. 162
  163. 163
  164. 164
  165. 165
  166. 166
  167. 167
  168. 168
  169. 169
  170. 170
  171. 171
  172. 172
  173. 173
  174. 174
  175. 175
  176. 176
  177. 177
  178. 178
  179. 179
  180. 180
  181. 181
  182. 182
  183. 183
  184. 184
  185. 185
  186. 186
  187. 187
  188. 188
  189. 189
  190. 190
  191. 191
  192. 192
  193. 193
  194. 194
  195. 195
  196. 196
  197. 197
  198. 198
  199. 199
  200. 200
  201. 201
  202. 202
  203. 203
  204. 204
  205. 205
  206. 206
  207. 207
  208. 208
  209. 209
  210. 210
  211. 211
  212. 212
  213. 213
  214. 214
  215. 215
  216. 216
  217. 217
  218. 218
  219. 219
  220. 220
  221. 221
  222. 222
  223. 223
  224. 224
  225. 225
  226. 226
  227. 227
  228. 228
  229. 229
  230. 230
  231. 231
  232. 232
  233. 233
  234. 234
  235. 235
  236. 236
  237. 237
  238. 238
  239. 239
  240. 240
  241. 241
  242. 242
  243. 243
  244. 244
  245. 245
  246. 246
  247. 247
  248. 248
  249. 249
  250. 250
  251. 251
  252. 252
  253. 253
  254. 254
  255. 255
  256. 256
  257. 257
  258. 258
  259. 259
  260. 260
  261. 261
  262. 262
  263. 263
  264. 264
  265. 265
  266. 266
  267. 267
  268. 268
  269. 269
  270. 270
  271. 271
  272. 272
  273. 273
  274. 274
  275. 275
  276. 276
  277. 277
  278. 278
  279. 279
  280. 280
  281. 281
  282. 282
  283. 283
  284. 284
  285. 285
  286. 286
  287. 287
  288. 288
  289. 289
  290. 290
  291. 291
  292. 292
  293. 293
  294. 294
  295. 295
  296. 296
  297. 297
  298. 298
  299. 299
  300. 300
  301. 301
  302. 302
  303. 303
  304. 304
  305. 305
  306. 306
  307. 307
  308. 308
  309. 309
  310. 310
  311. 311
  312. 312
  313. 313
  314. 314
  315. 315
  316. 316
  317. 317
  318. 318
  319. 319
  320. 320
  321. 321
  322. 322
  323. 323
  324. 324
  325. 325
  326. 326
  327. 327
  328. 328
  329. 329
  330. 330
  331. 331
  332. 332
  333. 333
  334. 334
  335. 335
  336. 336
  337. 337
  338. 338
  339. 339
  340. 340
  341. 341
  342. 342
  343. 343
  344. 344
  345. 345
  346. 346
  347. 347
  348. 348
  349. 349
  350. 350
  351. 351
  352. 352
  353. 353
  354. 354
  355. 355
  356. 356
  357. 357
  358. 358
  359. 359
  360. 360
  361. 361
  362. 362
  363. 363
  364. 364
  365. 365
  366. 366
  367. 367
  368. 368
  369. 369
  370. 370
  371. 371
  372. 372
  373. 373
  374. 374
  375. 375
  376. 376
  377. 377
  378. 378
  379. 379
  380. 380
  381. 381
  382. 382
  383. 383
  384. 384
  385. 385
  386. 386
  387. 387
  388. 388
  389. 389
  390. 390
  391. 391
  392. 392
  393. 393
  394. 394
  395. 395
  396. 396
  397. 397
  398. 398
  399. 399
  400. 400
  401. 401
  402. 402
  403. 403
  404. 404
  405. 405
  406. 406
  407. 407
  408. 408
  409. 409
  410. 410
  411. 411
  412. 412
  413. 413
  414. 414
  415. 415
  416. 416
  417. 417
  418. 418
  419. 419
  420. 420
  421. 421
  422. 422
  423. 423
  424. 424
  425. 425
  426. 426
  427. 427
  428. 428
  429. 429
  430. 430
  431. 431
  432. 432
  433. 433
  434. 434
  435. 435
  436. 436
  437. 437
  438. 438
  439. 439
  440. 440
  441. 441
  442. 442
  443. 443
  444. 444
  445. 445
  446. 446
  447. 447
  448. 448
  449. 449
  450. 450
  451. 451
  452. 452
  453. 453
  454. 454
  455. 455
  456. 456
  457. 457
  458. 458
  459. 459
  460. 460
  461. 461
  462. 462
  463. 463
  464. 464
  465. 465
  466. 466
  467. 467
  468. 468
  469. 469
  470. 470
  471. 471
  472. 472
  473. 473
  474. 474
  475. 475
  476. 476
  477. 477
  478. 478
  479. 479
  480. 480
  481. 481
  482. 482
  483. 483
  484. 484
  485. 485
  486. 486
  487. 487
  488. 488
  489. 489
  490. 490
  491. 491
  492. 492
  493. 493
  494. 494
  495. 495
  496. 496
  497. 497
  498. 498
  499. 499
  500. 500
  501. 501
  502. 502
  503. 503
  504. 504
  505. 505
  506. 506
  507. 507
  508. 508
  509. 509
  510. 510
  511. 511
  512. 512
  513. 513
  514. 514
  515. 515
  516. 516
  517. 517
  518. 518
  519. 519
  520. 520
  521. 521
  522. 522
  523. 523
  524. 524
  525. 525
  526. 526
  527. 527
  528. 528
  529. 529
  530. 530
  531. 531
  532. 532
  533. 533
  534. 534
  535. 535
  536. 536
  537. 537
  538. 538
  539. 539
  540. 540
  541. 541
  542. 542
  543. 543
  544. 544
  545. 545
  546. 546
  547. 547
  548. 548
  549. 549
  550. 550
  551. 551
  552. 552
  553. 553
  554. 554
  555. 555
  556. 556
  557. 557
  558. 558
  559. 559
  560. 560
  561. 561
  562. 562
  563. 563
  564. 564
  565. 565
  566. 566
  567. 567
  568. 568
  569. 569
  570. 570
  571. 571
  572. 572
  573. 573
  574. 574
  575. 575
  576. 576
  577. 577
  578. 578
  579. 579
  580. 580
  581. 581
  582. 582
  583. 583
  584. 584
  585. 585
  586. 586
  587. 587
  588. 588
  589. 589
  590. 590
  591. 591
  592. 592
  593. 593
  594. 594
  595. 595
  596. 596
  597. 597
  598. 598
  599. 599
  600. 600
  601. 601
  602. 602
  603. 603
  604. 604
  605. 605
  606. 606
  607. 607
  608. 608
  609. 609
  610. 610
  611. 611
  612. 612
  613. 613
  614. 614
  615. 615
  616. 616
  617. 617
  618. 618
  619. 619
  620. 620
  621. 621
  622. 622
  623. 623
  624. 624
  625. 625
  626. 626
  627. 627
  628. 628
  629. 629
  630. 630
  631. #include<iostream>
  632. #include<fstream>
  633. #include <sstream>
  634. #include <string.h>
  635. #include <math.h>
  636. #include <cstdlib>
  637. using namespace std;
  638. #define SIZE 100
  639. #define DataNumber 5000//用來設定最多可讀幾筆資料
  640.  
  641. //變數未定名、各係數單位未標示
  642. FILE *fin;
  643. int i = 0;//公用計數器
  644. int t = 0;//公用計數器2
  645. int z = 0;//公用計數器3
  646. char ReadLine[SIZE];//公用讀行
  647. float a = 1.44;//初始流量
  648. float CN1 = 37;//CN值
  649. float CN2 = 38;
  650. float CN3 = 39;
  651. float b1 = 40.34;//初期扣除量
  652. float b2 = 35;
  653. float b3 = 26.44;
  654. float c1[10][19] = {10.00, 27.20, 23.10, 17.50, 9.50, 4.88, 2.00, 1.00, 0.50, 0.30, 0.10, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00};//單位歷線
  655. float c2[10][19] = {3.20, 9.74, 15.21, 13.96, 13.31, 7.70, 5.13, 2.50, 1.50, 0.90, 0.60, 0.40, 0.20, 0.10, 0.10, 0.00, 0.00, 0.00, 0.00, 0.00};
  656. float c3[10][19] = {14.31, 4.87, 1.33, 0.99, 0.10, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00};
  657. int DataCounter = 0;//計算讀了幾筆資料(自0開始)
  658. string Time[DataNumber];//自0開始儲存資料檔之時間
  659. float Rainfall[DataNumber] = {0};//自0開始儲存資料檔之雨量
  660. float BaseFlowCoefficient1 = 0.5;
  661. float BaseFlowCoefficient2 = 0.39;
  662. float BaseFlowCoefficient3 = 0.11;
  663. float SimulatedRunoff[DataNumber] = {0};
  664. void ReadSetting()//讀取設定檔案
  665. {
  666. float b1Tmp_1(3),b2Tmp_1,b3Tmp_1;//用來儲存情境1初期扣除量參數
  667. float b1Tmp_2,b2Tmp_2,b3Tmp_2;//用來儲存情境2初期扣除量參數
  668. float b1Tmp_3,b2Tmp_3,b3Tmp_3;//用來儲存情境3初期扣除量參數
  669. float CN1Tmp_1,CN2Tmp_1,CN3Tmp_1;//用來儲存情境1CN值參數
  670. float CN1Tmp_2,CN2Tmp_2,CN3Tmp_2;//用來儲存情境2CN值參數
  671. float CN1Tmp_3,CN2Tmp_3,CN3Tmp_3;//用來儲存情境3CN值參數
  672. char OptionFile[SIZE] = "Setting.ini";
  673. if (!fin)
  674. {
  675. cout << "找不到參數設定檔(Setting.ini),已創建設定檔案,請重新執行本程式。" << endl;
  676. FILE *outfp0;//輸出檔案
  677. outfp0=fopen("Setting.ini","w");
  678. fprintf(outfp0,"基流係數1\t0.5\n基流係數2\t0.39\n基流係數3\t0.11\n單位歷線(10min)1\t10.00,27.20,23.10,17.50,9.50,4.88,2.00,1.00,0.50,0.30,0.10,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00\n單位歷線(10min)2\t3.20,9.74,15.21,13.96,13.31,7.70,5.13,2.50,1.50,0.90,0.60,0.40,0.20,0.10,0.10,0.00,0.00,0.00,0.00,0.00\n單位歷線(10min)3\t14.31,4.87,1.33,0.99,0.10,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00\n","");
  679. fprintf(outfp0,"情境1_CN值1\t37\n情境1_CN值2\t38\n情境1_CN值3\t39\n情境2_CN值1\t64.64\n情境2_CN值2\t69.28\n情境2_CN值3\t65.56\n情境3_CN值1\t77.25\n情境3_CN值2\t78\n情境3_CN值3\t79.69\n","");
  680. fprintf(outfp0,"情境1_初期扣除量1\t40.34\n情境1_初期扣除量2\t35\n情境1_初期扣除量3\t26.44\n情境2_初期扣除量1\t29.87\n情境2_初期扣除量2\t28.45\n情境2_初期扣除量3\t18.65\n情境3_初期扣除量1\t19.5\n情境3_初期扣除量2\t21\n情境3_初期扣除量3\t14.5","");
  681. fclose(outfp0);
  682. exit(1);
  683. system("pause");
  684. }
  685. else
  686. {
  687. fin = fopen(OptionFile, "r");
  688. cout << "參數設定檔(Setting.ini)讀取成功" << endl;
  689. i = 0;
  690. char ReadOption1[100];
  691. char ReadOption2[100];
  692. while(fscanf(fin,"%s%s", &ReadOption1, &ReadOption2) !=EOF)
  693. {
  694. switch(i)
  695. {
  696. case 0:
  697. BaseFlowCoefficient1 = atof(ReadOption2);
  698. break;
  699. case 1:
  700. BaseFlowCoefficient2 = atof(ReadOption2);
  701. break;
  702. case 2:
  703. BaseFlowCoefficient3 = atof(ReadOption2);
  704. break;
  705. case 3:
  706. {
  707. t = 0;
  708. stringstream ReadOption2Tmp_1(ReadOption2);
  709. string OptionReaderTmp_1;
  710. while(t < 20)
  711. {
  712. getline(ReadOption2Tmp_1,OptionReaderTmp_1,',');
  713. stringstream OptionReader_1(OptionReaderTmp_1);
  714. OptionReader_1 >> c1[0][t];
  715. t++;
  716. }
  717. }
  718. break;
  719. case 4:
  720. {
  721. t = 0;
  722. stringstream ReadOption2Tmp_2(ReadOption2);
  723. string OptionReaderTmp_2;
  724. while(t < 20)
  725. {
  726. getline(ReadOption2Tmp_2,OptionReaderTmp_2,',');
  727. stringstream OptionReader_2(OptionReaderTmp_2);
  728. OptionReader_2 >> c2[0][t];
  729. t++;
  730. }
  731. }
  732. break;
  733. case 5:
  734. {
  735. t = 0;
  736. stringstream ReadOption2Tmp_3(ReadOption2);
  737. string OptionReaderTmp_3;
  738. while(t < 20)
  739. {
  740. getline(ReadOption2Tmp_3,OptionReaderTmp_3,',');
  741. stringstream OptionReader_3(OptionReaderTmp_3);
  742. OptionReader_3 >> c3[0][t];
  743. t++;
  744. }
  745. }
  746. case 6:
  747. CN1Tmp_1 = atof(ReadOption2);
  748. break;
  749. case 7:
  750. CN2Tmp_1 = atof(ReadOption2);
  751. break;
  752. case 8:
  753. CN3Tmp_1 = atof(ReadOption2);
  754. break;
  755. case 9:
  756. CN1Tmp_2 = atof(ReadOption2);
  757. break;
  758. case 10:
  759. CN2Tmp_2 = atof(ReadOption2);
  760. break;
  761. case 11:
  762. CN3Tmp_2 = atof(ReadOption2);
  763. break;
  764. case 12:
  765. CN1Tmp_3 = atof(ReadOption2);
  766. break;
  767. case 13:
  768. CN2Tmp_3 = atof(ReadOption2);
  769. break;
  770. case 14:
  771. CN3Tmp_3 = atof(ReadOption2);
  772. break;
  773. case 15:
  774. b1Tmp_1 = atof(ReadOption2);
  775. break;
  776. case 16:
  777. b2Tmp_1 = atof(ReadOption2);
  778. break;
  779. case 17:
  780. b3Tmp_1 = atof(ReadOption2);
  781. break;
  782. case 18:
  783. b1Tmp_2 = atof(ReadOption2);
  784. break;
  785. case 19:
  786. b2Tmp_2 = atof(ReadOption2);
  787. break;
  788. case 20:
  789. b3Tmp_2 = atof(ReadOption2);
  790. break;
  791. case 21:
  792. b1Tmp_3 = atof(ReadOption2);
  793. break;
  794. case 22:
  795. b2Tmp_3 = atof(ReadOption2);
  796. break;
  797. case 23:
  798. b3Tmp_3 = atof(ReadOption2);
  799. break;
  800. }
  801. i++;
  802. }
  803.  
  804. /*if(a < 20)
  805.   {
  806.   b1 = b1Tmp_1;
  807.   b2 = b2Tmp_1;
  808.   b3 = b3Tmp_1;
  809.   CN1 = CN1Tmp_1;
  810.   CN2 = CN2Tmp_1;
  811.   CN3 = CN3Tmp_1;
  812.   }
  813.   else if(20 <= a && a<40)
  814.   {
  815.   b1 = b1Tmp_2;
  816.   b2 = b2Tmp_2;
  817.   b3 = b3Tmp_2;
  818.   CN1 = CN1Tmp_2;
  819.   CN2 = CN2Tmp_2;
  820.   CN3 = CN3Tmp_2;
  821.   }
  822.   else if(40 <= a)
  823.   {
  824.   b1 = b1Tmp_3;
  825.   b2 = b2Tmp_3;
  826.   b3 = b3Tmp_3;
  827.   CN1 = CN1Tmp_3;
  828.   CN2 = CN2Tmp_3;
  829.   CN3 = CN3Tmp_3;
  830.   }*/
  831. }
  832. system("pause");
  833. system("CLS");
  834. cout << "初始流量:" << a << endl << endl;
  835. cout << "\t\t溪流1\t溪流2\t溪流3" << endl;
  836. cout << "CN值\t\t" << CN1 << "\t" << CN2 << "\t" << CN3 << endl;
  837. cout << "初期扣除量\t" << b1 << "\t" << b2 << "\t" << b3 << endl;
  838. cout << "基流係數\t" << BaseFlowCoefficient1 << "\t" << BaseFlowCoefficient2 << "\t" << BaseFlowCoefficient3 << endl;
  839. cout << "\t\t----以下為單位歷線----\n";
  840. cout << "\t時序\t溪流1\t溪流2\t溪流3\n";
  841. i = 0;
  842. while(i < 20)
  843. {
  844. cout << "\t" << i + 1 << "hr\t" << c1[0][i] << "\t" << c2[0][i] << "\t" << c3[0][i] << endl;
  845. i++;
  846. }
  847. }
  848. void ReadData()
  849. {
  850. fstream DataFile;
  851. char DataFileName[SIZE];
  852. cout << "請輸入檔案名稱(不含附檔名.txt):";
  853. cin >> DataFileName;
  854. strcat(DataFileName,".txt");
  855. DataFile.open(DataFileName,ios::in);
  856. if(!DataFile)
  857. {
  858. FILE *outfp1;//輸出檔案
  859. outfp1=fopen("Sample.txt","w");
  860. fprintf(outfp1,"Time\tRainfall\tQ\n");
  861. fprintf(outfp1,"2013/7/13 01:00\t0.9\t25\n2013/7/13 02:00\t2.5\t3\n2013/7/13 03:00\t5.4\t3\n2013/7/13 04:00\t0.3\t3\n2013/7/13 05:00\t0.5\t3\n2013/7/13 06:00\t4.8\t3\n2013/7/13 07:00\t3\t3\n2013/7/13 08:00\t3.8\t3\n2013/7/13 09:00\t3\t3\n2013/7/13 10:00\t3.7\t3\n2013/7/13 11:00\t0.4\t3\n2013/7/13 12:00\t0\t3\n2013/7/13 13:00\t4.3\t3\n2013/7/13 14:00\t0.4\t3\n2013/7/13 15:00\t0.1\t3\n2013/7/13 16:00\t7\t3\n2013/7/13 17:00\t0.6\t3\n2013/7/13 18:00\t0\t3\n2013/7/13 19:00\t0\t3\n2013/7/13 20:00\t0\t3\n2013/7/13 21:00\t0\t3\n2013/7/13 22:00\t0.1\t3\n2013/7/13 23:00\t0.6\t3\n2013/7/14 00:00\t2.7\t3\n2013/7/14 01:00\t2.7\t3\n2013/7/14 02:00\t3.8\t3\n2013/7/14 03:00\t0\t3\n2013/7/14 04:00\t1.6\t3\n2013/7/14 05:00\t8.9\t3\n2013/7/14 06:00\t0\t3\n2013/7/14 07:00\t0\t3\n2013/7/14 08:00\t0.2\t3\n2013/7/14 09:00\t7.8\t3\n2013/7/14 10:00\t10.1\t3\n2013/7/14 11:00\t26.5\t3\n2013/7/14 12:00\t12.5\t3\n2013/7/14 13:00\t6.1\t3\n2013/7/14 14:00\t3.3\t3\n2013/7/14 15:00\t0.9\t3\n2013/7/14 16:00\t0\t3\n2013/7/14 17:00\t0\t3\n2013/7/14 18:00\t0.9\t3\n2013/7/14 19:00\t7.8\t3\n2013/7/14 20:00\t50.5\t3\n2013/7/14 21:00\t0.5\t3\n2013/7/14 22:00\t7.5\t3\n2013/7/14 23:00\t12.6\t3\n2013/7/15 00:00\t14.8\t3\n2013/7/15 01:00\t6.6\t3\n2013/7/15 02:00\t4.6\t3\n2013/7/15 03:00\t5.7\t3\n2013/7/15 04:00\t11.7\t3\n2013/7/15 05:00\t24.3\t3\n2013/7/15 06:00\t8\t3\n2013/7/15 07:00\t3.4\t3\n2013/7/15 08:00\t8.4\t3\n2013/7/15 09:00\t8.2\t3\n2013/7/15 10:00\t16.6\t3\n2013/7/15 11:00\t6.4\t3\n2013/7/15 12:00\t7.9\t3\n2013/7/15 13:00\t19.1\t3\n2013/7/15 14:00\t4.6\t3\n2013/7/15 15:00\t1\t3\n2013/7/15 16:00\t0.7\t3\n2013/7/15 17:00\t1.7\t3\n2013/7/15 18:00\t3.2\t3\n2013/7/15 19:00\t2.1\t3\n2013/7/15 20:00\t2.8\t3\n2013/7/15 21:00\t4\t3\n2013/7/15 22:00\t0.1\t3\n2013/7/15 23:00\t0.2\t3\n2013/7/16 00:00\t2.5\t3\n2013/7/16 01:00\t0.2\t3\n2013/7/16 02:00\t0.6\t3\n2013/7/16 03:00\t1.1\t3\n2013/7/16 04:00\t6.3\t3\n2013/7/16 05:00\t15.5\t3\n2013/7/16 06:00\t32.2\t3\n2013/7/16 07:00\t3.9\t3\n2013/7/16 08:00\t0\t3\n2013/7/16 09:00\t0.2\t3\n2013/7/16 10:00\t0\t3\n2013/7/16 11:00\t0\t3\n2013/7/16 12:00\t0\t3\n2013/7/16 13:00\t0\t3\n2013/7/16 14:00\t0\t3\n2013/7/16 15:00\t0\t3\n2013/7/16 16:00\t0\t3\n2013/7/16 17:00\t0\t3\n2013/7/16 18:00\t0\t3\n2013/7/16 19:00\t0\t3\n2013/7/16 20:00\t0\t3\n2013/7/16 21:00\t0\t3\n2013/7/16 22:00\t0.4\t3\n2013/7/16 23:00\t0.1\t3\n2013/7/17 00:00\t0.1\t3");
  862. fclose(outfp1);
  863. cout << "找不到資料檔(" << DataFileName << "),已創建範例檔案(Sample.txt),請重新執行本程式。" << endl;
  864. system("pause");
  865. exit(1);
  866. }
  867. else
  868. {
  869. char DataReader[SIZE];
  870. char DataReaderTmp[SIZE];
  871. i = 0;
  872. while(DataFile.getline(DataReader,sizeof(DataReader),'\n'))
  873. {
  874. switch(i)
  875. {
  876. case 0://讀到標題列(Time、Rainfall)
  877. break;
  878. /*case 97:
  879.   cout << "資料超過96筆,請確認資料檔(" << DataFileName << ")無誤。" << endl;
  880.   exit(1);
  881.   break;*/
  882. default:
  883. {
  884. if(i == 1)
  885. {
  886.  
  887. }
  888.  
  889. stringstream DataReaderTmp(DataReader);
  890. string DataReaderSplit;
  891. t = 0;
  892. while(t < 3)
  893. {
  894. getline(DataReaderTmp,DataReaderSplit,'\t');
  895. switch(t)
  896. {
  897. case 0:
  898. {
  899. Time[i - 1] = DataReaderSplit;
  900. }
  901. case 1:
  902. {
  903. stringstream RainfallTmp(DataReaderSplit);
  904. RainfallTmp >> Rainfall[i-1];
  905. break;
  906. }
  907. case 2:
  908. {
  909. if(i == 1)
  910. {
  911. stringstream DataQ(DataReaderSplit);
  912. DataQ >> a;
  913. if(a < 20)
  914. {
  915. b1 = 40.34;
  916. b2 = 35;
  917. b3 = 26.44;
  918. CN1 = 37;
  919. CN2 = 38;
  920. CN3 = 39;
  921. }
  922. else if(20 <= a && a < 100)
  923. {
  924. b1 = 29.87;
  925. b2 = 28.45;
  926. b3 = 18.65;
  927. CN1 = 64.64;
  928. CN2 = 69.28;
  929. CN3 = 65.56;
  930. }
  931. else if(100 <= a)
  932. {
  933. b1 = 19.5;
  934. b2 = 21;
  935. b3 = 14.5;
  936. CN1 = 77.25;
  937. CN2 = 78;
  938. CN3 = 79.69;
  939. }
  940. }
  941. break;
  942. }
  943. }
  944. t++;
  945. }
  946. break;
  947. }
  948. }
  949. DataCounter++;//※為何-2
  950. i++;
  951. }
  952. }
  953. }
  954. void TimeCalc()
  955. {
  956. //cout << "最後一筆時間:" << Time[DataCounter - 2] << endl;
  957. system("pause");
  958. string TimeSplit;
  959. string Year;
  960. string Month;
  961. string Day;
  962. string Hour;
  963. string Minute;
  964. i = 0;
  965. while(i < 19)//拆時間
  966. {
  967. //cout << "Time[" << DataCounter -2 + i << "]=" << Time[DataCounter -2 + i] << endl;
  968. stringstream TimeTmp;
  969. TimeTmp << Time[DataCounter - 2 + i];
  970. t = 0;
  971. while(t < 2)
  972. {
  973. getline(TimeTmp,TimeSplit,' ');
  974. stringstream DateSplit(TimeSplit);
  975. switch(t)
  976. {
  977. case 0://讀到日期
  978. {
  979. z = 0;
  980. while(z < 3)
  981. {
  982. switch(z)
  983. {
  984. case 0:
  985. getline(DateSplit,Year,'/');
  986. break;
  987. case 1:
  988. getline(DateSplit,Month,'/');
  989. break;
  990. case 2:
  991. getline(DateSplit,Day,'/');
  992. break;
  993. }
  994. z++;
  995. }
  996. break;
  997. }
  998. case 1://讀到時間
  999. {
  1000. z = 0;
  1001. while(z < 2)
  1002. {
  1003. switch(z)
  1004. {
  1005. case 0:
  1006. getline(DateSplit,Hour,':');
  1007. break;
  1008. case 1://拆分鐘,本程式無用
  1009. getline(DateSplit,Minute,':');
  1010. break;
  1011. }
  1012. z++;
  1013. }
  1014. break;
  1015. }
  1016. }
  1017. t++;
  1018. }
  1019. stringstream HourCalcTmp(Hour);
  1020. stringstream DayCalcTmp(Day);
  1021. stringstream MonthCalcTmp(Month);
  1022. stringstream YearCalcTmp(Year);
  1023. int HourCalc;
  1024. int DayCalc;
  1025. int MonthCalc;
  1026. int YearCalc;
  1027. HourCalcTmp >> HourCalc;
  1028. DayCalcTmp >> DayCalc;
  1029. MonthCalcTmp >> MonthCalc;
  1030. YearCalcTmp >> YearCalc;
  1031. //cout << "RAR=" << YearCalc << endl;
  1032. int DayofMonth = 999;
  1033. if((YearCalc%4==0 && YearCalc%100!=0)||(YearCalc%400==0))
  1034. {
  1035. DayofMonth = 29;
  1036. }
  1037. else
  1038. {
  1039. switch(MonthCalc)//判斷該月天數
  1040. {
  1041. case 1:
  1042. case 3:
  1043. case 5:
  1044. case 7:
  1045. case 8:
  1046. case 10:
  1047. case 12:
  1048. DayofMonth = 31;
  1049. break;
  1050. default:
  1051. DayofMonth = 30;
  1052. break;
  1053. }
  1054. }
  1055. HourCalc++;
  1056. if(HourCalc == 24)
  1057. {
  1058. HourCalc = 0;
  1059. DayCalc++;
  1060. if(DayCalc == DayofMonth)//閏年判斷
  1061. {
  1062. DayCalc = 1;
  1063. MonthCalc++;
  1064. if(MonthCalc == 13)
  1065. {
  1066. MonthCalc = 1;
  1067. YearCalc++;
  1068. }
  1069. }
  1070. }
  1071. stringstream YearOutput,MonthOutput,DayOutput,HourOutput;
  1072. HourOutput << HourCalc;
  1073. DayOutput << DayCalc;
  1074. MonthOutput << MonthCalc;
  1075. YearOutput << YearCalc;
  1076. HourOutput >> Hour;
  1077. DayOutput >> Day;
  1078. MonthOutput >> Month;
  1079. YearOutput >> Year;
  1080.  
  1081. /*if(MonthCalc < 10)//加零用
  1082.   {
  1083.   Month = "0" + Month;
  1084.   Month = Month.append("0",0);
  1085.   }
  1086.   if(DayCalc < 10)
  1087.   {
  1088.   Day = Day.append("0",0);
  1089.   }*/
  1090. if(HourCalc < 10)
  1091. {
  1092. Hour = Hour.append("0",0);
  1093. Hour = "0" + Hour;
  1094. }
  1095. Time[DataCounter -2 + i + 1] = Year + "/" + Month + "/" + Day + " " + Hour + ":00";
  1096. Rainfall[DataCounter - 2 + i + 1] = 0;
  1097. i++;
  1098. }
  1099. }
  1100. void CalcRiver()
  1101. {
  1102. float SValue_1((25400-254*CN1)/CN1);//計算S值1
  1103. float SValue_2((25400-254*CN2)/CN2);//計算S值2
  1104. float SValue_3((25400-254*CN3)/CN3);//計算S值3
  1105. float AccumulationRainfall[DataNumber] = {0};//計算累積降雨(mm)
  1106. float ExcessRainfall_1[DataNumber] = {0};//判斷超滲降雨1
  1107. float ExcessRainfall_2[DataNumber] = {0};//判斷超滲降雨2
  1108. float ExcessRainfall_3[DataNumber] = {0};//判斷超滲降雨3
  1109. float Pe_1[DataNumber] = {0};//計算累積有效降雨1
  1110. float Pe_2[DataNumber] = {0};//計算累積有效降雨2
  1111. float Pe_3[DataNumber] = {0};//計算累積有效降雨3
  1112. float EffectiveHydrograph_1[DataNumber] = {0};//有效降雨阻體圖1
  1113. float EffectiveHydrograph_2[DataNumber] = {0};//有效降雨阻體圖2
  1114. float EffectiveHydrograph_3[DataNumber] = {0};//有效降雨阻體圖3
  1115. //float WaterLoss[DataNumber];//計算降雨損失,暫無用處
  1116. float CompositeUnitHydrograph_1[DataNumber] = {0};
  1117. float CompositeUnitHydrograph_2[DataNumber] = {0};
  1118. float CompositeUnitHydrograph_3[DataNumber] = {0};
  1119. float SumBaseFlow_1[DataNumber]= {0};
  1120. float SumBaseFlow_2[DataNumber]= {0};
  1121. float SumBaseFlow_3[DataNumber]= {0};
  1122. i = 0;
  1123. while(i < DataCounter - 1 + 19)//輸出至最後一筆資料算完單位歷線,※為何DataCounter要-1?
  1124. {
  1125. switch(i)
  1126. {
  1127. case 0:
  1128. AccumulationRainfall[i] = Rainfall[i];
  1129. break;
  1130. default:
  1131. AccumulationRainfall[i] = Rainfall[i] + AccumulationRainfall[i-1];
  1132. break;
  1133. }
  1134. if(AccumulationRainfall[i] >= b1)
  1135. {
  1136. ExcessRainfall_1[i] = AccumulationRainfall[i];
  1137. }
  1138. else
  1139. {
  1140. ExcessRainfall_1[i] = b1;
  1141. }
  1142.  
  1143. if(AccumulationRainfall[i] >= b2)
  1144. {
  1145. ExcessRainfall_2[i] = AccumulationRainfall[i];
  1146. }
  1147. else
  1148. {
  1149. ExcessRainfall_2[i] = b2;
  1150. }
  1151.  
  1152. if(AccumulationRainfall[i] >= b3)
  1153. {
  1154. ExcessRainfall_3[i] = AccumulationRainfall[i];
  1155. }
  1156. else
  1157. {
  1158. ExcessRainfall_3[i] = b3;
  1159. }
  1160. Pe_1[i] = pow((ExcessRainfall_1[i] - b1),2)/(ExcessRainfall_1[i] - b1 + SValue_1);//※此處存在捨位誤差
  1161. Pe_2[i] = pow((ExcessRainfall_2[i] - b2),2)/(ExcessRainfall_2[i] - b2 + SValue_2);
  1162. Pe_3[i] = pow((ExcessRainfall_3[i] - b3),2)/(ExcessRainfall_3[i] - b3 + SValue_3);
  1163. //cout << Pe_1[i] << "\t\t" << Pe_2[i] << "\t\t" << Pe_3[i] << endl;
  1164. switch(i)
  1165. {
  1166. case 0:
  1167. EffectiveHydrograph_1[i] = Pe_1[i];
  1168. EffectiveHydrograph_2[i] = Pe_2[i];
  1169. EffectiveHydrograph_3[i] = Pe_3[i];
  1170. break;
  1171. default:
  1172. EffectiveHydrograph_1[i] = Pe_1[i] - Pe_1[i-1];
  1173. EffectiveHydrograph_2[i] = Pe_2[i] - Pe_2[i-1];
  1174. EffectiveHydrograph_3[i] = Pe_3[i] - Pe_3[i-1];
  1175. }
  1176. //cout << EffectiveHydrograph_1[i] << "\t\t" << EffectiveHydrograph_2[i] << "\t\t" << EffectiveHydrograph_1[i] << endl;
  1177. /*if(Rainfall[i] == 0)
  1178.   {
  1179.   WaterLoss[i] = Rainfall[i];
  1180.   }
  1181.   else
  1182.   {
  1183.   WaterLoss[i] = Rainfall[i] - EffectiveHydrograph[i];
  1184.   }*/
  1185. t = 0;
  1186. while(t < 20)
  1187. {
  1188. if(i - t >= 0)
  1189. {
  1190. CompositeUnitHydrograph_1[i] += EffectiveHydrograph_1[i - t] * (c1[0][i - (i - t)] / 10);
  1191. CompositeUnitHydrograph_2[i] += EffectiveHydrograph_2[i - t] * (c2[0][i - (i - t)] / 10);
  1192. CompositeUnitHydrograph_3[i] += EffectiveHydrograph_3[i - t] * (c3[0][i - (i - t)] / 10);
  1193. }
  1194. else if(i - t < 0)
  1195. {
  1196. break;
  1197. }
  1198. t++;
  1199. }
  1200. SumBaseFlow_1[i] = CompositeUnitHydrograph_1[i] + a * BaseFlowCoefficient1;
  1201. SumBaseFlow_2[i] = CompositeUnitHydrograph_2[i] + a * BaseFlowCoefficient2;
  1202. SumBaseFlow_3[i] = CompositeUnitHydrograph_3[i] + a * BaseFlowCoefficient3;
  1203. SimulatedRunoff[i] =SumBaseFlow_1[i] + SumBaseFlow_2[i] + SumBaseFlow_3[i];
  1204. //cout << CompositeUnitHydrograph_1[i] << "\t" << CompositeUnitHydrograph_2[i] << "\t" << CompositeUnitHydrograph_3[i] << endl;
  1205. //cout << SumBaseFlow_1[i] << "\t" << SumBaseFlow_2[i] << "\t" << SumBaseFlow_3[i] << endl;
  1206. //cout << i + 1 << "\t" << SimulatedRunoff[i] << endl;
  1207. //system("pause");
  1208. i++;
  1209. }
  1210. }
  1211.  
  1212.  
  1213.  
  1214.  
  1215. int main()
  1216. {
  1217. ReadSetting();//讀取參數設定
  1218. ReadData();//讀取資料
  1219. /*cout << "初始流量:" << a << endl << endl;
  1220.   cout << "\t\t溪流1\t溪流2\t溪流3" << endl;
  1221.   cout << "CN值\t\t" << CN1 << "\t" << CN2 << "\t" << CN3 << endl;
  1222.   cout << "初期扣除量\t" << b1 << "\t" << b2 << "\t" << b3 << endl;
  1223.   cout << "基流係數\t" << BaseFlowCoefficient1 << "\t" << BaseFlowCoefficient2 << "\t" << BaseFlowCoefficient3 << endl;
  1224.   cout << "\t\t----以下為單位歷線----\n";
  1225.   cout << "\t時序\t溪流1\t溪流2\t溪流3\n";*/
  1226. i = 0;
  1227. /*while(i < 20)
  1228.   {
  1229.   cout << "\t" << i + 1 << "hr\t" << c1[0][i] << "\t" << c2[0][i] << "\t" << c3[0][i] << endl;
  1230.   i++;
  1231.   }*/
  1232. TimeCalc();
  1233. CalcRiver();
  1234. i = 0;
  1235. int OutputStopper = 0;//用來中斷檔案輸出
  1236. fstream outfp2;
  1237. outfp2.open("Output.txt",ios::out);
  1238. outfp2 << "時間\t模擬入流量(cms)\n";
  1239. while(i < DataCounter - 1 + 19)//※為何DataCounter要-1?
  1240. {
  1241. outfp2 << Time[i] << "\t" << SimulatedRunoff[i] << "\n";
  1242. if(SimulatedRunoff[i] == SimulatedRunoff[i-1] && 0 < i)
  1243. {
  1244. OutputStopper++;
  1245. /*if(OutputStopper == 7)//累積0~7共八個,相同輸出結果就終止
  1246.   {
  1247.   outfp2.close();
  1248.   break;
  1249.   }*/
  1250. }
  1251. else
  1252. {
  1253. OutputStopper = 0;//若無連續八個就歸零
  1254. }
  1255. i++;
  1256. }
  1257. outfp2.close();
  1258. cout << "共讀取" << DataCounter - 1 <<"筆資料並輸出結果檔(Output.txt),即將關閉程式" << endl;
  1259. system("pause");
  1260. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:631:1: error: stray ‘\357’ in program
 #include<iostream>
 ^
prog.cpp:631:2: error: stray ‘\273’ in program
 #include<iostream>
  ^
prog.cpp:631:3: error: stray ‘\277’ in program
 #include<iostream>
   ^
prog.cpp:631:4: error: stray ‘#’ in program
 #include<iostream>
    ^
prog.cpp:1:1: error: expected unqualified-id before numeric constant
 1
 ^
In file included from /usr/include/c++/6/iosfwd:40:0,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/postypes.h:98:11: error: ‘ptrdiff_t’ does not name a type
   typedef ptrdiff_t streamsize; // Signed integral type
           ^~~~~~~~~
In file included from /usr/include/c++/6/exception:172:0,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/exception_ptr.h:99:30: error: field ‘nullptr_t’ has incomplete type ‘std::__exception_ptr::exception_ptr’
       exception_ptr(nullptr_t) noexcept
                              ^
/usr/include/c++/6/bits/exception_ptr.h:79:11: note: definition of ‘class std::__exception_ptr::exception_ptr’ is not complete until the closing brace
     class exception_ptr
           ^~~~~~~~~~~~~
/usr/include/c++/6/bits/exception_ptr.h:99:30: error: expected ‘;’ at end of member declaration
       exception_ptr(nullptr_t) noexcept
                              ^
/usr/include/c++/6/bits/exception_ptr.h:99:32: error: expected unqualified-id before ‘noexcept’
       exception_ptr(nullptr_t) noexcept
                                ^~~~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:359:31: error: ‘std::size_t’ has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/6/type_traits:360:25: error: ‘_Size’ was not declared in this scope
     struct is_array<_Tp[_Size]>
                         ^~~~~
/usr/include/c++/6/type_traits:360:31: error: template argument 1 is invalid
     struct is_array<_Tp[_Size]>
                               ^
/usr/include/c++/6/type_traits:558:37: error: ‘nullptr_t’ is not a member of ‘std’
     struct __is_null_pointer_helper<std::nullptr_t>
                                     ^~~
/usr/include/c++/6/type_traits:558:37: error: ‘nullptr_t’ is not a member of ‘std’
/usr/include/c++/6/type_traits:558:51: error: template argument 1 is invalid
     struct __is_null_pointer_helper<std::nullptr_t>
                                                   ^
/usr/include/c++/6/type_traits:1478:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                ^~~
/usr/include/c++/6/type_traits:1478:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1478:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                ^~~
/usr/include/c++/6/type_traits:1478:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1478:61: error: template argument 1 is invalid
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                                             ^
/usr/include/c++/6/type_traits:1478:61: note: invalid template non-type parameter
/usr/include/c++/6/type_traits:1483:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 0> { };
                                ^~~
/usr/include/c++/6/type_traits:1483:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1483:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 0> { };
                                ^~~
/usr/include/c++/6/type_traits:1483:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1483:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/6/type_traits:1483:46: note: invalid template non-type parameter
/usr/include/c++/6/type_traits:1485:31: error: ‘std::size_t’ has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/6/type_traits:1486:21: error: ‘_Size’ was not declared in this scope
     struct rank<_Tp[_Size]>
                     ^~~~~
/usr/include/c++/6/type_traits:1486:27: error: template argument 1 is invalid
     struct rank<_Tp[_Size]>
                           ^
/usr/include/c++/6/type_traits:1487:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                ^~~
/usr/include/c++/6/type_traits:1487:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1487:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                ^~~
/usr/include/c++/6/type_traits:1487:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1487:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/6/type_traits:1487:65: note: invalid template non-type parameter
/usr/include/c++/6/type_traits:1491:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                ^~~
/usr/include/c++/6/type_traits:1491:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1491:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                ^~~
/usr/include/c++/6/type_traits:1491:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1491:65: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                                                 ^
/usr/include/c++/6/type_traits:1491:65: note: invalid template non-type parameter
/usr/include/c++/6/type_traits:1496:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 0> { };
                                ^~~
/usr/include/c++/6/type_traits:1496:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1496:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t, 0> { };
                                ^~~
/usr/include/c++/6/type_traits:1496:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1496:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/6/type_traits:1496:46: note: invalid template non-type parameter
/usr/include/c++/6/type_traits:1498:47: error: ‘std::size_t’ has not been declared
   template<typename _Tp, unsigned _Uint, std::size_t _Size>
                                               ^~~~~~
/usr/include/c++/6/type_traits:1499:23: error: ‘_Size’ was not declared in this scope
     struct extent<_Tp[_Size], _Uint>
                       ^~~~~
/usr/include/c++/6/type_traits:1499:36: error: template argument 1 is invalid
     struct extent<_Tp[_Size], _Uint>
                                    ^
/usr/include/c++/6/type_traits:1500:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t,
                                ^~~
/usr/include/c++/6/type_traits:1500:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1500:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t,
                                ^~~
/usr/include/c++/6/type_traits:1500:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1501:24: error: ‘_Size’ was not declared in this scope
           _Uint == 0 ? _Size : extent<_Tp,
                        ^~~~~
/usr/include/c++/6/type_traits:1502:28: error: template argument 1 is invalid
           _Uint - 1>::value>
                            ^
/usr/include/c++/6/type_traits:1502:28: note: invalid template non-type parameter
/usr/include/c++/6/type_traits:1507:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t,
                                ^~~
/usr/include/c++/6/type_traits:1507:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1507:32: error: ‘size_t’ is not a member of ‘std’
     : public integral_constant<std::size_t,
                                ^~~
/usr/include/c++/6/type_traits:1507:32: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/bits/move.h:57:0,
                 from /usr/include/c++/6/bits/nested_exception.h:40,
                 from /usr/include/c++/6/exception:173,
                 from /usr/include/c++/6/ios:39,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/type_traits:1509:31: error: template argument 1 is invalid
              _Uint - 1>::value>
                               ^
/usr/include/c++/6/type_traits:1509:31: note: invalid template non-type parameter
/usr/include/c++/6/type_traits:1958:31: error: ‘std::size_t’ has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/6/type_traits:1959:30: error: ‘_Size’ was not declared in this scope
     struct remove_extent<_Tp[_Size]>
                              ^~~~~
/usr/include/c++/6/type_traits:1959:36: error: template argument 1 is invalid
     struct remove_extent<_Tp[_Size]>
                                    ^
/usr/include/c++/6/type_traits:1971:31: error: ‘std::size_t’ has not been declared
   template<typename _Tp, std::size_t _Size>
                               ^~~~~~
/usr/include/c++/6/type_traits:1972:35: error: ‘_Size’ was not declared in this scope
     struct remove_all_extents<_Tp[_Size]>
                                   ^~~~~
/usr/include/c++/6/type_traits:1972:41: error: template argument 1 is invalid
     struct remove_all_extents<_Tp[_Size]>
                                         ^
/usr/include/c++/6/type_traits:2030:17: error: ‘std::size_t’ has not been declared
   template<std::size_t _Len>
                 ^~~~~~
/usr/include/c++/6/type_traits:2035:23: error: ‘_Len’ was not declared in this scope
  unsigned char __data[_Len];
                       ^~~~
/usr/include/c++/6/type_traits:2050:17: error: ‘std::size_t’ has not been declared
   template<std::size_t _Len, std::size_t _Align =
                 ^~~~~~
/usr/include/c++/6/type_traits:2050:35: error: ‘std::size_t’ has not been declared
   template<std::size_t _Len, std::size_t _Align =
                                   ^~~~~~
/usr/include/c++/6/type_traits:2051:48: error: ‘_Len’ was not declared in this scope
     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                ^~~~
/usr/include/c++/6/type_traits:2051:52: error: template argument 1 is invalid
     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
                                                    ^
/usr/include/c++/6/type_traits:2056:23: error: ‘_Len’ was not declared in this scope
  unsigned char __data[_Len];
                       ^~~~
/usr/include/c++/6/type_traits:2057:37: error: ‘_Align’ was not declared in this scope
  struct __attribute__((__aligned__((_Align)))) { } __align;
                                     ^~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:62:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/type_traits.h:162:35: error: ‘__gnu_cxx::__is_null_pointer’ declared as an ‘inline’ variable
   __is_null_pointer(std::nullptr_t)
                                   ^
/usr/include/c++/6/ext/type_traits.h:162:35: error: ‘bool __gnu_cxx::__is_null_pointer’ redeclared as different kind of symbol
/usr/include/c++/6/ext/type_traits.h:157:5: note: previous declaration ‘template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)’
     __is_null_pointer(_Type)
     ^~~~~~~~~~~~~~~~~
/usr/include/c++/6/ext/type_traits.h:162:21: error: ‘nullptr_t’ is not a member of ‘std’
   __is_null_pointer(std::nullptr_t)
                     ^~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:64:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/stl_pair.h:85:17: error: ‘std::size_t’ has not been declared
   template<std::size_t...>
                 ^~~~~~
/usr/include/c++/6/bits/stl_pair.h:421:41: error: ‘std::size_t’ has not been declared
       template<typename... _Args1, std::size_t... _Indexes1,
                                         ^~~~~~
/usr/include/c++/6/bits/stl_pair.h:422:41: error: ‘std::size_t’ has not been declared
                typename... _Args2, std::size_t... _Indexes2>
                                         ^~~~~~
/usr/include/c++/6/bits/stl_pair.h:424:27: error: ‘_Indexes1’ was not declared in this scope
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                           ^~~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:424:36: error: expected parameter pack before ‘...’
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                    ^~~
/usr/include/c++/6/bits/stl_pair.h:424:39: error: template argument 1 is invalid
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                       ^
/usr/include/c++/6/bits/stl_pair.h:424:55: error: ‘_Indexes2’ was not declared in this scope
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                                       ^~~~~~~~~
/usr/include/c++/6/bits/stl_pair.h:424:64: error: expected parameter pack before ‘...’
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                                                ^~~
/usr/include/c++/6/bits/stl_pair.h:424:67: error: template argument 1 is invalid
              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
                                                                   ^
In file included from /usr/include/c++/6/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/stl_iterator_base_types.h:116:67: error: ‘ptrdiff_t’ does not name a type
   template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
                                                                   ^~~~~~~~~
/usr/include/c++/6/bits/stl_iterator_base_types.h:182:15: error: ‘ptrdiff_t’ does not name a type
       typedef ptrdiff_t                   difference_type;
               ^~~~~~~~~
/usr/include/c++/6/bits/stl_iterator_base_types.h:193:15: error: ‘ptrdiff_t’ does not name a type
       typedef ptrdiff_t                   difference_type;
               ^~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:108:5: error: ‘ptrdiff_t’ does not name a type
     ptrdiff_t
     ^~~~~~~~~
/usr/include/c++/6/bits/stl_iterator_base_funcs.h:114:5: error: ‘ptrdiff_t’ does not name a type
     ptrdiff_t
     ^~~~~~~~~
In file included from /usr/include/c++/6/bits/stl_iterator.h:66:0,
                 from /usr/include/c++/6/bits/stl_algobase.h:67,
                 from /usr/include/c++/6/bits/char_traits.h:39,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/ptr_traits.h:100:20: error: ‘ptrdiff_t’ was not declared in this scope
  = __detected_or_t<ptrdiff_t, __difference_type, _Ptr>;
                    ^~~~~~~~~
/usr/include/c++/6/bits/ptr_traits.h:100:54: error: template argument 1 is invalid
  = __detected_or_t<ptrdiff_t, __difference_type, _Ptr>;
                                                      ^
/usr/include/c++/6/bits/ptr_traits.h:129:15: error: ‘ptrdiff_t’ does not name a type
       typedef ptrdiff_t difference_type;
               ^~~~~~~~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/stl_algobase.h: In static member function ‘static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*)’:
/usr/include/c++/6/bits/stl_algobase.h:366:10: error: ‘ptrdiff_t’ does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^~~~~~~~~
/usr/include/c++/6/bits/stl_algobase.h:367:8: error: ‘_Num’ was not declared in this scope
    if (_Num)
        ^~~~
/usr/include/c++/6/bits/stl_algobase.h:369:22: error: ‘_Num’ was not declared in this scope
    return __result + _Num;
                      ^~~~
/usr/include/c++/6/bits/stl_algobase.h: In static member function ‘static _Tp* std::__copy_move_backward<_IsMove, true, std::random_access_iterator_tag>::__copy_move_b(const _Tp*, const _Tp*, _Tp*)’:
/usr/include/c++/6/bits/stl_algobase.h:568:10: error: ‘ptrdiff_t’ does not name a type
    const ptrdiff_t _Num = __last - __first;
          ^~~~~~~~~
/usr/include/c++/6/bits/stl_algobase.h:569:8: error: ‘_Num’ was not declared in this scope
    if (_Num)
        ^~~~
/usr/include/c++/6/bits/stl_algobase.h:571:22: error: ‘_Num’ was not declared in this scope
    return __result - _Num;
                      ^~~~
In file included from /usr/include/c++/6/ios:40:0,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/char_traits.h: At global scope:
/usr/include/c++/6/bits/char_traits.h:104:66: error: ‘std::size_t’ has not been declared
       compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
                                                                  ^~~~~~
/usr/include/c++/6/bits/char_traits.h:106:19: error: ‘size_t’ in namespace ‘std’ does not name a type
       static std::size_t
                   ^~~~~~
/usr/include/c++/6/bits/char_traits.h:110:39: error: ‘std::size_t’ has not been declared
       find(const char_type* __s, std::size_t __n, const char_type& __a);
                                       ^~~~~~
/usr/include/c++/6/bits/char_traits.h:113:57: error: ‘std::size_t’ has not been declared
       move(char_type* __s1, const char_type* __s2, std::size_t __n);
                                                         ^~~~~~
/usr/include/c++/6/bits/char_traits.h:116:57: error: ‘std::size_t’ has not been declared
       copy(char_type* __s1, const char_type* __s2, std::size_t __n);
                                                         ^~~~~~
/usr/include/c++/6/bits/char_traits.h:119:35: error: ‘std::size_t’ has not been declared
       assign(char_type* __s, std::size_t __n, char_type __a);
                                   ^~~~~~
/usr/include/c++/6/bits/char_traits.h:145:64: error: ‘std::size_t’ has not been declared
     compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
                                                                ^~~~~~
/usr/include/c++/6/bits/char_traits.h: In static member function ‘static int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)’:
/usr/include/c++/6/bits/char_traits.h:147:12: error: ‘size_t’ is not a member of ‘std’
       for (std::size_t __i = 0; __i < __n; ++__i)
            ^~~
/usr/include/c++/6/bits/char_traits.h:147:12: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ios:40:0,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/char_traits.h:147:33: error: ‘__i’ was not declared in this scope
       for (std::size_t __i = 0; __i < __n; ++__i)
                                 ^~~
/usr/include/c++/6/bits/char_traits.h: At global scope:
/usr/include/c++/6/bits/char_traits.h:156:10: error: ‘size_t’ in namespace ‘std’ does not name a type
     std::size_t
          ^~~~~~
/usr/include/c++/6/bits/char_traits.h:169:37: error: ‘std::size_t’ has not been declared
     find(const char_type* __s, std::size_t __n, const char_type& __a)
                                     ^~~~~~
/usr/include/c++/6/bits/char_traits.h: In static member function ‘static const char_type* __gnu_cxx::char_traits<_CharT>::find(const char_type*, int, const char_type&)’:
/usr/include/c++/6/bits/char_traits.h:171:12: error: ‘size_t’ is not a member of ‘std’
       for (std::size_t __i = 0; __i < __n; ++__i)
            ^~~
/usr/include/c++/6/bits/char_traits.h:171:12: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ios:40:0,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/char_traits.h:171:33: error: ‘__i’ was not declared in this scope
       for (std::size_t __i = 0; __i < __n; ++__i)
                                 ^~~
/usr/include/c++/6/bits/char_traits.h: At global scope:
/usr/include/c++/6/bits/char_traits.h:180:55: error: ‘std::size_t’ has not been declared
     move(char_type* __s1, const char_type* __s2, std::size_t __n)
                                                       ^~~~~~
/usr/include/c++/6/bits/char_traits.h:189:55: error: ‘std::size_t’ has not been declared
     copy(char_type* __s1, const char_type* __s2, std::size_t __n)
                                                       ^~~~~~
/usr/include/c++/6/bits/char_traits.h:199:33: error: ‘std::size_t’ has not been declared
     assign(char_type* __s, std::size_t __n, char_type __a)
                                 ^~~~~~
In file included from /usr/include/c++/6/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/new:116:31: error: declaration of ‘operator new’ as non-function
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                               ^
/usr/include/c++/6/new:116:20: error: ‘size_t’ is not a member of ‘std’
 void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                    ^~~
/usr/include/c++/6/new:116:20: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/new:118:33: error: declaration of ‘operator new []’ as non-function
 void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                                 ^
/usr/include/c++/6/new:118:22: error: ‘size_t’ is not a member of ‘std’
 void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
                      ^~~
/usr/include/c++/6/new:118:22: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/new:125:34: error: ‘std::size_t’ has not been declared
 void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
                                  ^~~~~~
/usr/include/c++/6/new:127:36: error: ‘std::size_t’ has not been declared
 void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
                                    ^~~~~~
/usr/include/c++/6/new:130:25: error: declaration of ‘operator new’ as non-function
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                         ^~~~~~
/usr/include/c++/6/new:130:20: error: ‘size_t’ is not a member of ‘std’
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                    ^~~
/usr/include/c++/6/new:130:20: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/new:130:33: error: expected primary-expression before ‘const’
 void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                 ^~~~~
/usr/include/c++/6/new:132:27: error: declaration of ‘operator new []’ as non-function
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                           ^~~~~~
/usr/include/c++/6/new:132:22: error: ‘size_t’ is not a member of ‘std’
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                      ^~~
/usr/include/c++/6/new:132:22: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/new:132:35: error: expected primary-expression before ‘const’
 void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                   ^~~~~
/usr/include/c++/6/new:139:34: error: ‘std::size_t’ has not been declared
 void operator delete(void*, std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                  ^~~~~~
/usr/include/c++/6/new:141:36: error: ‘std::size_t’ has not been declared
 void operator delete[](void*, std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
                                    ^~~~~~
/usr/include/c++/6/new:146:32: error: declaration of ‘operator new’ as non-function
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                ^~~~~~
/usr/include/c++/6/new:146:27: error: ‘size_t’ is not a member of ‘std’
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                           ^~~
/usr/include/c++/6/new:146:27: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/new:146:40: error: expected primary-expression before ‘void’
 inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                        ^~~~
/usr/include/c++/6/new:148:34: error: declaration of ‘operator new []’ as non-function
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                  ^~~~~~
/usr/include/c++/6/new:148:29: error: ‘size_t’ is not a member of ‘std’
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                             ^~~
/usr/include/c++/6/new:148:29: note: suggested alternative:
In file included from /usr/include/wchar.h:51:0,
                 from /usr/include/c++/6/cwchar:44,
                 from /usr/include/c++/6/bits/postypes.h:40,
                 from /usr/include/c++/6/iosfwd:40,
                 from /usr/include/c++/6/ios:38,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h:216:23: note:   ‘size_t’
 typedef __SIZE_TYPE__ size_t;
                       ^~~~~~
In file included from /usr/include/c++/6/ext/new_allocator.h:33:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/new:148:42: error: expected primary-expression before ‘void’
 inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
                                          ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/6/bits/c++allocator.h:33:0,
                 from /usr/include/c++/6/bits/allocator.h:46,
                 from /usr/include/c++/6/string:41,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/new_allocator.h:44:14: error: ‘std::size_t’ has not been declared
   using std::size_t;
              ^~~~~~
/usr/include/c++/6/ext/new_allocator.h:45:14: error: ‘std::ptrdiff_t’ has not been declared
   using std::ptrdiff_t;
              ^~~~~~~~~
/usr/include/c++/6/ext/new_allocator.h:62:15: error: ‘ptrdiff_t’ does not name a type
       typedef ptrdiff_t  difference_type;
               ^~~~~~~~~
In file included from /usr/include/c++/6/string:41:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/allocator.h:72:15: error: ‘ptrdiff_t’ does not name a type
       typedef ptrdiff_t   difference_type;
               ^~~~~~~~~
/usr/include/c++/6/bits/allocator.h:112:15: error: ‘ptrdiff_t’ does not name a type
       typedef ptrdiff_t  difference_type;
               ^~~~~~~~~
In file included from /usr/include/c++/6/string:44:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/ostream_insert.h:45:26: error: ‘streamsize’ has not been declared
       const _CharT* __s, streamsize __n)
                          ^~~~~~~~~~
/usr/include/c++/6/bits/ostream_insert.h: In function ‘void std::__ostream_write(std::basic_ostream<_CharT, _Traits>&, const _CharT*, int)’:
/usr/include/c++/6/bits/ostream_insert.h:50:13: error: ‘streamsize’ does not name a type
       const streamsize __put = __out.rdbuf()->sputn(__s, __n);
             ^~~~~~~~~~
/usr/include/c++/6/bits/ostream_insert.h:51:11: error: ‘__put’ was not declared in this scope
       if (__put != __n)
           ^~~~~
/usr/include/c++/6/bits/ostream_insert.h: At global scope:
/usr/include/c++/6/bits/ostream_insert.h:57:59: error: ‘streamsize’ has not been declared
     __ostream_fill(basic_ostream<_CharT, _Traits>& __out, streamsize __n)
                                                           ^~~~~~~~~~
/usr/include/c++/6/bits/ostream_insert.h:77:27: error: ‘streamsize’ has not been declared
        const _CharT* __s, streamsize __n)
                           ^~~~~~~~~~
/usr/include/c++/6/bits/ostream_insert.h: In function ‘std::basic_ostream<_CharT, _Traits>& std::__ostream_insert(std::basic_ostream<_CharT, _Traits>&, const _CharT*, int)’:
/usr/include/c++/6/bits/ostream_insert.h:87:14: error: ‘streamsize’ does not name a type
        const streamsize __w = __out.width();
              ^~~~~~~~~~
/usr/include/c++/6/bits/ostream_insert.h:88:12: error: ‘__w’ was not declared in this scope
        if (__w > __n)
            ^~~
/usr/include/c++/6/bits/ostream_insert.h: At global scope:
/usr/include/c++/6/bits/ostream_insert.h:118:68: error: ‘streamsize’ has not been declared
   extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
                                                                    ^~~~~~~~~~
/usr/include/c++/6/bits/ostream_insert.h:122:11: error: ‘streamsize’ has not been declared
           streamsize);
           ^~~~~~~~~~
In file included from /usr/include/c++/6/ext/alloc_traits.h:36:0,
                 from /usr/include/c++/6/bits/basic_string.h:40,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/alloc_traits.h:384:36: error: ‘ptrdiff_t’ in namespace ‘std’ does not name a type
       using difference_type = std::ptrdiff_t;
                                    ^~~~~~~~~
/usr/include/c++/6/bits/alloc_traits.h:387:30: error: ‘size_t’ in namespace ‘std’ does not name a type
       using size_type = std::size_t;
                              ^~~~~~
/usr/include/c++/6/bits/alloc_traits.h:415:37: error: ‘size_type’ has not been declared
       allocate(allocator_type& __a, size_type __n)
                                     ^~~~~~~~~
/usr/include/c++/6/bits/alloc_traits.h:429:37: error: ‘size_type’ has not been declared
       allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
                                     ^~~~~~~~~
/usr/include/c++/6/bits/alloc_traits.h:441:52: error: ‘size_type’ has not been declared
       deallocate(allocator_type& __a, pointer __p, size_type __n)
                                                    ^~~~~~~~~
/usr/include/c++/6/bits/alloc_traits.h:474:14: error: ‘size_type’ does not name a type
       static size_type
              ^~~~~~~~~
In file included from /usr/include/c++/6/bits/basic_string.h:5417:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/string_conversions.h:55:51: error: ‘std::size_t’ has not been declared
     const char* __name, const _CharT* __str, std::size_t* __idx,
                                                   ^~~~~~
/usr/include/c++/6/ext/string_conversions.h:89:48: error: ‘std::size_t’ has not been declared
     __to_xstring(int (*__convf) (_CharT*, std::size_t, const _CharT*,
                                                ^~~~~~
/usr/include/c++/6/ext/string_conversions.h:90:31: error: ‘std::size_t’ has not been declared
      __builtin_va_list), std::size_t __n,
                               ^~~~~~
In file included from /usr/include/c++/6/bits/basic_string.h:40:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/alloc_traits.h: In instantiation of ‘struct __gnu_cxx::__alloc_traits<std::allocator<char> >’:
/usr/include/c++/6/bits/basic_string.h:75:24:   required from ‘class std::__cxx11::basic_string<char>’
/usr/include/c++/6/bits/basic_string.h:5428:68:   required from here
/usr/include/c++/6/ext/alloc_traits.h:61:53: error: no type named ‘size_type’ in ‘struct std::allocator_traits<std::allocator<char> >’
     typedef typename _Base_type::size_type          size_type;
                                                     ^~~~~~~~~
/usr/include/c++/6/ext/alloc_traits.h:62:53: error: no type named ‘difference_type’ in ‘struct std::allocator_traits<std::allocator<char> >’
     typedef typename _Base_type::difference_type    difference_type;
                                                     ^~~~~~~~~~~~~~~
/usr/include/c++/6/ext/alloc_traits.h:70:23: error: no members matching ‘__gnu_cxx::__alloc_traits<std::allocator<char> >::_Base_type {aka std::allocator_traits<std::allocator<char> >}::max_size’ in ‘__gnu_cxx::__alloc_traits<std::allocator<char> >::_Base_type {aka struct std::allocator_traits<std::allocator<char> >}’
     using _Base_type::max_size;
                       ^~~~~~~~
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/basic_string.h: In function ‘int std::__cxx11::stoi(const string&, size_t*, int)’:
/usr/include/c++/6/bits/basic_string.h:5429:19: error: no matching function for call to ‘__stoa(long int (*)(const char*, char**, int) throw (), const char [5], const char*, size_t*&, int&)’
      __idx, __base); }
                   ^
In file included from /usr/include/c++/6/bits/basic_string.h:5417:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/string_conversions.h:54:5: note: candidate: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^~~~~~
/usr/include/c++/6/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/basic_string.h:5429:19: note:   cannot convert ‘__idx’ (type ‘size_t* {aka long unsigned int*}’) to type ‘int*’
      __idx, __base); }
                   ^
/usr/include/c++/6/bits/basic_string.h: In function ‘long int std::__cxx11::stol(const string&, size_t*, int)’:
/usr/include/c++/6/bits/basic_string.h:5434:22: error: no matching function for call to ‘__stoa(long int (*)(const char*, char**, int) throw (), const char [5], const char*, size_t*&, int&)’
         __idx, __base); }
                      ^
In file included from /usr/include/c++/6/bits/basic_string.h:5417:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/string_conversions.h:54:5: note: candidate: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^~~~~~
/usr/include/c++/6/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/basic_string.h:5434:22: note:   cannot convert ‘__idx’ (type ‘size_t* {aka long unsigned int*}’) to type ‘int*’
         __idx, __base); }
                      ^
/usr/include/c++/6/bits/basic_string.h: In function ‘long unsigned int std::__cxx11::stoul(const string&, size_t*, int)’:
/usr/include/c++/6/bits/basic_string.h:5439:22: error: no matching function for call to ‘__stoa(long unsigned int (*)(const char*, char**, int) throw (), const char [6], const char*, size_t*&, int&)’
         __idx, __base); }
                      ^
In file included from /usr/include/c++/6/bits/basic_string.h:5417:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/string_conversions.h:54:5: note: candidate: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^~~~~~
/usr/include/c++/6/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/basic_string.h:5439:22: note:   cannot convert ‘__idx’ (type ‘size_t* {aka long unsigned int*}’) to type ‘int*’
         __idx, __base); }
                      ^
/usr/include/c++/6/bits/basic_string.h: In function ‘long long int std::__cxx11::stoll(const string&, size_t*, int)’:
/usr/include/c++/6/bits/basic_string.h:5444:22: error: no matching function for call to ‘__stoa(long long int (*)(const char*, char**, int) throw (), const char [6], const char*, size_t*&, int&)’
         __idx, __base); }
                      ^
In file included from /usr/include/c++/6/bits/basic_string.h:5417:0,
                 from /usr/include/c++/6/string:52,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/ext/string_conversions.h:54:5: note: candidate: template<class _TRet, class _Ret, class _CharT, class ... _Base> _Ret __gnu_cxx::__stoa(_TRet (*)(const _CharT*, _CharT**, _Base ...), const char*, const _CharT*, int*, _Base ...)
     __stoa(_TRet (*__convf) (const _CharT*, _CharT**, _Base...),
     ^~~~~~
/usr/include/c++/6/ext/string_conversions.h:54:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/fstream:38,
                 from prog.cpp:632:
/usr/include/c++/6/bits/basic_string.h:5444:22: note:   cannot convert ‘__idx’ (type ‘size_t* {aka long unsigned int*}’) to type ‘int*’
         __idx, __base); }
                      ^
/usr/include/c++/6/bits/basic_string.h: In function ‘long long unsigned int std::__cxx11::stoull(const string&, size_t*, int)’:
/usr/include/c++/6/bits/basic_string.h:5449:22: error: no matching function for call to ‘__stoa(long long unsigned int (*)(const char*, char**, int) throw (), const char [7], const char*, size_t*&, int&)’
         __idx, __base); }
           
stdout
Standard output is empty