fork download
  1. #include <map>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. std::map<int, int> a;
  8. for(int i=1;i<=1000;i+=5)
  9. a[i]=i*i;
  10. auto it = a.begin();
  11. while (it != a.end())
  12. {
  13. cout << it->first << " has a value of " << it->second << endl;
  14. ++it;
  15. }
  16. }
Success #stdin #stdout 0s 3232KB
stdin
Standard input is empty
stdout
1 has a value of 1
6 has a value of 36
11 has a value of 121
16 has a value of 256
21 has a value of 441
26 has a value of 676
31 has a value of 961
36 has a value of 1296
41 has a value of 1681
46 has a value of 2116
51 has a value of 2601
56 has a value of 3136
61 has a value of 3721
66 has a value of 4356
71 has a value of 5041
76 has a value of 5776
81 has a value of 6561
86 has a value of 7396
91 has a value of 8281
96 has a value of 9216
101 has a value of 10201
106 has a value of 11236
111 has a value of 12321
116 has a value of 13456
121 has a value of 14641
126 has a value of 15876
131 has a value of 17161
136 has a value of 18496
141 has a value of 19881
146 has a value of 21316
151 has a value of 22801
156 has a value of 24336
161 has a value of 25921
166 has a value of 27556
171 has a value of 29241
176 has a value of 30976
181 has a value of 32761
186 has a value of 34596
191 has a value of 36481
196 has a value of 38416
201 has a value of 40401
206 has a value of 42436
211 has a value of 44521
216 has a value of 46656
221 has a value of 48841
226 has a value of 51076
231 has a value of 53361
236 has a value of 55696
241 has a value of 58081
246 has a value of 60516
251 has a value of 63001
256 has a value of 65536
261 has a value of 68121
266 has a value of 70756
271 has a value of 73441
276 has a value of 76176
281 has a value of 78961
286 has a value of 81796
291 has a value of 84681
296 has a value of 87616
301 has a value of 90601
306 has a value of 93636
311 has a value of 96721
316 has a value of 99856
321 has a value of 103041
326 has a value of 106276
331 has a value of 109561
336 has a value of 112896
341 has a value of 116281
346 has a value of 119716
351 has a value of 123201
356 has a value of 126736
361 has a value of 130321
366 has a value of 133956
371 has a value of 137641
376 has a value of 141376
381 has a value of 145161
386 has a value of 148996
391 has a value of 152881
396 has a value of 156816
401 has a value of 160801
406 has a value of 164836
411 has a value of 168921
416 has a value of 173056
421 has a value of 177241
426 has a value of 181476
431 has a value of 185761
436 has a value of 190096
441 has a value of 194481
446 has a value of 198916
451 has a value of 203401
456 has a value of 207936
461 has a value of 212521
466 has a value of 217156
471 has a value of 221841
476 has a value of 226576
481 has a value of 231361
486 has a value of 236196
491 has a value of 241081
496 has a value of 246016
501 has a value of 251001
506 has a value of 256036
511 has a value of 261121
516 has a value of 266256
521 has a value of 271441
526 has a value of 276676
531 has a value of 281961
536 has a value of 287296
541 has a value of 292681
546 has a value of 298116
551 has a value of 303601
556 has a value of 309136
561 has a value of 314721
566 has a value of 320356
571 has a value of 326041
576 has a value of 331776
581 has a value of 337561
586 has a value of 343396
591 has a value of 349281
596 has a value of 355216
601 has a value of 361201
606 has a value of 367236
611 has a value of 373321
616 has a value of 379456
621 has a value of 385641
626 has a value of 391876
631 has a value of 398161
636 has a value of 404496
641 has a value of 410881
646 has a value of 417316
651 has a value of 423801
656 has a value of 430336
661 has a value of 436921
666 has a value of 443556
671 has a value of 450241
676 has a value of 456976
681 has a value of 463761
686 has a value of 470596
691 has a value of 477481
696 has a value of 484416
701 has a value of 491401
706 has a value of 498436
711 has a value of 505521
716 has a value of 512656
721 has a value of 519841
726 has a value of 527076
731 has a value of 534361
736 has a value of 541696
741 has a value of 549081
746 has a value of 556516
751 has a value of 564001
756 has a value of 571536
761 has a value of 579121
766 has a value of 586756
771 has a value of 594441
776 has a value of 602176
781 has a value of 609961
786 has a value of 617796
791 has a value of 625681
796 has a value of 633616
801 has a value of 641601
806 has a value of 649636
811 has a value of 657721
816 has a value of 665856
821 has a value of 674041
826 has a value of 682276
831 has a value of 690561
836 has a value of 698896
841 has a value of 707281
846 has a value of 715716
851 has a value of 724201
856 has a value of 732736
861 has a value of 741321
866 has a value of 749956
871 has a value of 758641
876 has a value of 767376
881 has a value of 776161
886 has a value of 784996
891 has a value of 793881
896 has a value of 802816
901 has a value of 811801
906 has a value of 820836
911 has a value of 829921
916 has a value of 839056
921 has a value of 848241
926 has a value of 857476
931 has a value of 866761
936 has a value of 876096
941 has a value of 885481
946 has a value of 894916
951 has a value of 904401
956 has a value of 913936
961 has a value of 923521
966 has a value of 933156
971 has a value of 942841
976 has a value of 952576
981 has a value of 962361
986 has a value of 972196
991 has a value of 982081
996 has a value of 992016