-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello_world.cpp
More file actions
1496 lines (1425 loc) · 38.3 KB
/
hello_world.cpp
File metadata and controls
1496 lines (1425 loc) · 38.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include <algorithm>
#include <iostream>
#include <ranges>
#include <string>
#include <vector>
#include "hello_world.h"
//#include "std_lib_facilities.h"
using namespace std;
//int main()
//{
// string name1 = "";
// double age = 0;
// cout << "Please enter you name and age: \n";
// std::cin >> name1;
// cin >> age;
// cout << "Your name is: " << name1 << "and you are "<< age * 12<< " months old";
//
//}
//int main() // simple program to exercise operators
//{
// cout << "Please enter a interger−-point value: ";
// int n = 0;
// cin >> n;
// cout << "n == " << n
// << "\nn+1 == " << n + 1
// << "\nthree times n == " << 3 * n
// << "\ntwice n == " << n + n
// << "\nn squared == " << n * n
// << "\nhalf of n == " << n / 2
// << "\nsquare root of n == " << sqrt(n)
// << "\nremider of n by 2 is " << n % 2;
//}
//int main()
//{
//
// string previous; // previous word; initialized to ""
// string current; // current word
// while (cin >> current) { // read a stream of words
// int rep = 0;
// if (previous == current) // check if the word is the same as last
// cout << "\nrepeated word:" << current << '\n';
// cout << "\nCURR: " << current;
// cout << "\nPRE: " << previous;
// previous = current;
// }
//}
//
//int main()
//{
// int number_of_words = 0;
// string previous; // previous word; initialized to ""
// string current;
// while (cin >> current) {
// ++number_of_words; // increase word count
// if (previous == current)
// cout << "word number " << number_of_words << " repeated: " << current << '\n';
// previous = current;
// }
//}
//int main()
//{
// string s = "Goodbye, cruel world! ";
// cout << s << '\n';
//}
//int main()
//{
// //double d = 0;
// //while (cin >> d)
// //{ // repeat the statements below as long as we type in numbers
// // int i = d; // try to squeeze a floating-point value into an integer value
// // char c = i; // try to squeeze an integer into a char
// // cout << "d==" << d // the original double
// // << " i==" << i // double converted to int
// // << " c==" << c // int value of char
// // << " char(" << c << ")\n"; // the char
// //}
//}
//int main()
//{
// cout << "Enter the name of the person you want to write to\n";
// string first_name; // first_name is a variable of type string
// cin >> first_name; // read characters into first_name
// cout << "Dear, " << first_name << "!\n" << "How are you doing?\n";
// cin >> first_name;
// cout << "Have you seen " << first_name << " recently?!\n";
// int age = 0;
// cin >> age;
// cout << "I heard you have turned\n" << age << "\n";
// if (age == 0 || age >= 110) cout << "Wow that is very impressive\n";
// else if (age <= 12) cout << "Next year you will be " << age + 1 << "\n";
// else if (age >= 17) cout << "Next year you will be able to vote.\n";
// else if (age >= 70) cout << "Have you retired yet? \n";
//
// cout << "Yours sincerely " << "MohammadReza";
//
//}
//#include <iomanip>
//int main()
//{
// double d = 4294967296 / 2 - 1; // 2^32 = 4294967296, 2^32/2 = 2^31 = 2147483648
// //double d = 2147483648-1; // 2^32 = 4294967296, 2^32/2 = 2^31 = 2147483648
//
// int i = d; // implicit safe conversion
// double dd = i;
//
// if (d == dd)
// std::cout << "Safe conversion: d == dd, with d == " << std::fixed << d << "; i == " << i << "\n";
// else
// std::cout << "Unsafe conversion: d == " << std::fixed << d << "; dd == " << std::fixed << dd << "; i == " << i << "\n";
//}
//int main() // Programm to convert Miles to Kilomiters
//{
// double miles = 0;
// cout << "Please enter Miles to converet to Kilometers: \n";
// cin >> miles;
// cout << "Converting please be patient!\n";
// cout << miles << " miles is: " << miles * 1.609 << " kilometers";
//}
//
//int main()
//{
// double val1 = 0, val2 = 0;
// cout << "Please enter two doubles for our calculation. \n";
// cin >> val1 >> val2;
// if (val1 < val2) cout << val1 << " is smaller\n";else cout << val2 << " is smaller\n";
// if (val1 > val2) cout << val1 << " is bigger\n"; else cout << val2 << " is bigger\n";
// cout << "the sum of the two integers is: " << val1 + val2 << "\n";
// cout << "the difference between the two number is: " << val1 - val2 << "\n";
// cout << "the product of the two integers is: " << val1 * val2 << "\n";
// double ratio = 0;
// if (val1 < val2)
// {
// ratio = val1 / val2;
// cout << "the ratio between the two number is: " << ratio << "\n";
// }
// else
// {
// ratio = val2 / val1;
// cout << "the ratio between the two number is: " << ratio << "\n";
// }
//
//
// cout << "*************************************************************************\n";
//
//
// int val1 = 0, val2 = 0;
// cout << "Please enter two integers for our calculation. \n";
// cin >> val1 >> val2;
// if (val1 < val2) cout << val1 << " is smaller\n";else cout << val2 << " is smaller\n";
// if (val1 > val2) cout << val1 << " is bigger\n"; else cout << val2 << " is bigger\n";
// cout << "the sum of the two integers is: " << val1 + val2 << "\n";
// cout << "the difference between the two number is: " << val1 - val2 << "\n";
// cout << "the product of the two integers is: " << val1 * val2 << "\n";
// double ratio = 0;
// if (val1 < val2)
// {
// ratio = val1 / val2;
// cout << "the ratio between the two number is: " << ratio << "\n";
// }
// else
// {
// ratio = val2 / val1;
// cout << "the ratio between the two number is: " << ratio << "\n";
// }
//
//
//}
//int square(int x);
//int main()
//{
// //int val1 = 01, val2 = 02, val3 = 03;
// //cout << "Enter 3 integers: \n";
// //cin >> val1 >> val2 >> val3;
//
// //if (val1 == val2 == val3) { cout << val1 << ", " << val2 << ", " << val3; }
// //else if (val1 == val2) { cout << val1 << ", " << val2 << ", " << val3;}
// //else if (val1 == val3 ) { cout << val1 << ", " << val3 << ", " << val2;}
// //else if ( val2 == val3) { cout << val2 << ", " << val3 << ", " << val1; }
// //else { cout << val1 << ", " << val2 << ", " << val3; }
//
//// string val1, val2, val3;
//// cout << "Enter 3 Strings: \n";
//// cin >> val1 >> val2 >> val3;
////
//// if (val1 == val2 && val1 == val3 && val2 == val3 ) { cout << val1 << ", " << val2 << ", " << val3; }
//// else if (val1 == val2) { cout << val1 << ", " << val2 << ", " << val3; }
//// else if (val1 == val3) { cout << val1 << ", " << val3 << ", " << val2; }
//// else if (val2 == val3) { cout << val2 << ", " << val3 << ", " << val1; }
//// else { cout << val1 << ", " << val2 << ", " << val3; }
////
//
// /*int user_input1 = 00;
// cout << "Please enter a number to determine wheather it is even or odd: \n";
// cin >> user_input1;
//
// int reminder_of = user_input1 % 2;
// if(reminder_of == 0)
// {
// cout << "The number " << user_input1 << " is a even number.\n";
//
// }
// else
// {
// cout << "The number " << user_input1 << " is a odd number.\n";
//
// }
// */
//
// //while(true)
// //{
// // int user_input = 00;
// // cout << "Please enter a number that you would like to be spelled: ";
// // cin >> user_input;
// // switch (user_input)
// // {
// // case 0:
// // cout << "Zero\n";
// // break;
// // case 1:
// // cout << "One\n";
// // break;
// // case 2:
// // cout << "Two\n";
// // break;
// // case 3:
// // cout << "Three\n";
// // break;
// // case 4:
// // cout << "Four\n";
// // break;
// // default:
// // cout << "I don't know the number!! but I will learn it in future.\n";
// // break;
// // }
//
// //}
//
// //string operation = " ";
// //double operand_no1 = 01, operant_no2 = 02;
// //cout << "Please enter the two operand:\n";
// //cin >> operand_no1 >> operant_no2;
// //cout << "Please enter the operator: ";
// //cin >> operation;
// //
// //if(operation == "+")
// //{
// // cout << "The sum is: " << operand_no1 + operant_no2;
// //} else if(operation == "-")
// //{
// // cout <<"The substraction is: " << operand_no1 - operant_no2;
// //}
// //else if (operation == "*")
// //{
// // cout << "The multipilication is :" << operand_no1 * operant_no2;
// //}
// //else if (operation == "/")
// //{
// // cout << "The division is: " << operand_no1 / operant_no2;
// //}
//
//
// //constexpr double cm_per_inch = 2.54; // number of centimeters in an inch
// //double length = 1; // length in inches or centimeters
// //char unit = ' ';
// //cout << "Please enter a length followed by a unit (c or i):\n";
// //cin >> length >> unit;
// //if (unit == 'i')
// // cout << length << "in == " << length * cm_per_inch << "cm\n";
// //else
// // cout << length << "cm == " << length / cm_per_inch << "in\n";
//
///* double toman_to_dollars = 100000;
// double pound_to_dollards = 1.30;
// double euro_to_dollars = 1.09;
// string currency_sign;
// double user_inputed = 00;
//
// cout << "Please enter the amount you want to convert to US-Dollars(followed by the your own currency T/t for toman, E/e for euro and P/p for pound): \n";
// cin >> user_inputed >> currency_sign;
//
// if (currency_sign == "t" || currency_sign == "T") { cout << user_inputed << " toman equals " << user_inputed * toman_to_dollars << " dollars."; }
// else if (currency_sign == "p" || currency_sign == "P") { cout << user_inputed << " pound equals " << user_inputed * pound_to_dollards << " dollars."; }
// else if (currency_sign == "e" || currency_sign == "E") { cout << user_inputed << " euros equals " << user_inputed * euro_to_dollars << " dollars."; }
// ///*else { cout << "This system can not convert that currency to Dollars!"; }*/
// //double toman_to_dollars = 100000;
// //double pound_to_dollards = 1.30;
// //double euro_to_dollars = 1.09;
// //char currency_sign;
// //double user_inputed = 00;
//
// //cout << "Please enter the amount you want to convert to US-Dollars(followed by the your own currency T/t for toman, E/e for euro and P/p for pound): \n";
// //cin >> user_inputed >> currency_sign;
//
// //switch (currency_sign)
// //{
// //case 'T' : case 't' : cout << user_inputed << " toman equals " << user_inputed * toman_to_dollars << " dollars.";
// // break;
// //case 'P' : case 'p' : cout << user_inputed << " pound equals " << user_inputed * pound_to_dollards << " dollars.";
// // break;
// //case 'E' : case 'e' : cout << user_inputed << " euros equals " << user_inputed * euro_to_dollars << " dollars.";
// // break;
//
// //default:
// // cout << "This system can not convert that currency to Dollars!";
// // break;
// //}*/
//
//
//
//
// //int i = 0;
// //while(i <=100)
// //{
// // int ite = 0;
// // cout << char('a' + ite)<<"\n";
// // i++;
// //}
//
// /*char i = 'a';
// while(i <= 'z')
// {
// cout << i << "\t" << i - 0 << "\n"; // MINUS 0 is the way to conver Char To Int
// ++i;
// }*/
// // char I = 'A';
// //for (char i = 'a'; i <= 'z'; i++)
// //{
// // cout << I << "\t" << I - 0 << "\n";
// // cout << i << "\t" << i - 0 << "\n";
// // I++;
// //
// //}
// //for (char I = 'A'; I <= 'Z'; I++)
// //{
// // cout << I << "\t" << I - 0 << "\n";
// //}
// int user_in = 00;
// //cin >> user_in;
// //int results = square(user_in);
// //cout << "suared is: " << results;
// //
// //
// //}
// //int square(int x)
// //{
// // int result = 0;
// //
// // // Add x to the result x times
// // for (int i = 0; i < x; ++i)
// // {
// // result += x;
// // }
// //
// // return result;
// //}
//
// //int sqvureds(int x)
// //{
// // int results = 00;
// // for (int i = 0; i <= x; i++)
// // {
// // results = +x;
// // }
// // return results;
// //}
//
//
//}
//int main()
// // simple dictionary: list of sorted words
// {
// vector<string> words;
// for (string temp; cin >> temp;) // read whitespace-separated words
// words.push_back(temp); // put into vector
// cout << "Number of words:" << words.size() << '\n';
// ranges::sort(words); // sort the words
// for (int i = 0; i < words.size(); ++i)
// if (i == 0 || words[i−1] != words[i]) // is this a new word?
// cout << words[i] << "\n";
// }
//int main()
//{
//
// string words_I_dont_like00 = "qw";
// string words_I_dont_like01 = "we";
// string words_I_dont_like02 = "er";
// string words_I_dont_like03 = "re";
//
// string user_input = "";
//
// cout << "Please enter a word: \n";
// while (true)
// {
// cin >> user_input;
// if (user_input == words_I_dont_like00 || user_input == words_I_dont_like01 || user_input == words_I_dont_like02 || user_input == words_I_dont_like03)
// {
// cout << "Bleep\n";
// }
// else
// {
// cout << user_input << "\n";
// }
// }
//}
//for (string inputed_word; cin >> inputed_word;)
//{
// for (int i = 0; i <= diss_liked_words.size(); ++i)
// {
// if (inputed_word == diss_liked_words[i])
// {
// cout << "BLEEP\n";
// }
// else if(inputed_word != diss_liked_words[i])
// {
// cout << inputed_word << "\n";
// }
// }
////}
//int main()
//{
// //double input_no1 = 00, input_no2 = 01;
// //string termination_and_variable;
//
// //while (termination_and_variable != "|")
// //{
// // cin >> input_no1;
// // if (input_no1 > input_no2)
// // {
// // cout << "The smaller value is: " << input_no2 << "\n";
// // cout << "The larger value is: " << input_no1 << "\n";
// // if(input_no1 - input_no2 <= 1 || input_no2 - input_no1 <= 1)
// // {
// // cout << "The numbers are almost the same\n";
// // }
//
// // } else if (input_no1 < input_no2)
// // {
// // cout << "The smaller value is: " << input_no1 << "\n";
// // cout << "The larger value is: " << input_no2 << "\n";
// // if (input_no1 - input_no2 <= 1 || input_no2 - input_no1 <= 1)
// // {
// // cout << "The numbers are almost the same\n";
// // }
// // } else if (input_no1 == input_no2)
// // {
// // cout << "the numbers are equal\n";
// // }
//
// //
// //}
//
//}
//const vector<string> legal_units = { "cm", "m", "in", "ft" };
//constexpr double cm_to_m{ 0.01 };
//constexpr double in_to_m{ 2.54 * cm_to_m };
//constexpr double ft_to_m{ 12.0 * in_to_m };
//
//bool legal_unit_checker(string i_unit)
//{
// bool check_unit = false;
// for(string loop_unit : legal_units)
// {
// if(loop_unit == i_unit)
// {
// check_unit = true;
// }
// }
// return check_unit;
//}
//
//void print_legal_units()
//{
// cout << "cm for centimeters\n"
// << "tm for meters\n"
// << "in for inches\n"
// << "ft for feet\n";
//}
//
//double convert_to_meter(double val, string unit)
//{
// if(unit == "cm")
// {
// return val * cm_to_m;
// }
// else if(unit == "in")
// {
// return val * in_to_m;
// }
// else if(unit == "ft")
// {
// return val * ft_to_m;
// }
// else
// {
// return val;
// }
//}
//
//
//
//int main()
//{
//
// double input_user = 00;
// double val_to_meter = 00;
// double smallest = 00, largest = 00;
// bool first_Input = true;
// bool conditon_of_loop = true;
// string units;
//
// double sum_of_all = 0;
// vector<double> all_values;
//
// bool test = true;
//
// cout << "Please enter a value with its unit: \n";
// print_legal_units();
//
//
//
// while (true)
// {
// if (cin >> input_user >> units)
// {
// test = true;
// }
// else
// {
// test = false;
// }
//
// if(test)
// {
// if (legal_unit_checker(units))
// {
// val_to_meter = convert_to_meter(input_user, units);
// sum_of_all += val_to_meter;
// all_values.push_back(val_to_meter);
// if (units == "m")
// {
// cout << input_user << units << "\n";
// }
// else if (units != "m")
// {
// cout << val_to_meter << "m" << "\n";
// }
//
// if (first_Input == true)
// {
// smallest = input_user;
// largest = input_user;
// cout << "The smallest and the largest so far are: " << smallest << " " << largest << "\n";
// first_Input = false;
// }
//
//
// if (input_user < smallest)
// {
// smallest = val_to_meter;
// cout << "The smallest so far is: " << smallest << "m\n";
//
// }
// else if (input_user > largest)
// {
// largest = val_to_meter;
// cout << "The largest so far is: " << largest << "m\n";
//
// }
//
// }
// else
// {
// cout << "Not a valid unit please enter a valid one from below: \n";
// print_legal_units();
// }
//
// }
// else
// {
// cout << "The sum of values: " << sum_of_all << "\n";
// cout << "The largest value: " << largest << "\n";
// cout << "THe smallest: " << smallest << "\n";
// sort(all_values);
// for(auto val : all_values)
// {
// cout << "All the values that have been typed: " << val << "m\n";
// }
// break;
// }
//
// }
//
//}
//int main()
//{
// vector<int> test = { 1,2,3,4,5,6,7,8,9,10 };
// int sizeoftest = 0;
// for (auto i : test)
// {
// sizeoftest++;
// }
// cout << sizeoftest;
//
// return 0;
//}
//int main()
//{
// double distance_input = 0;
// vector<double> distances_vector;
// double sum_of_distance = 0;
// bool size_of_vector = true;
//
//
// while(cin >> distance_input)
// {
// distances_vector.push_back(distance_input);
// for (double i = 1 ; i < distances_vector.size(); ++i)
// {
// if (distances_vector[i] < distances_vector[i - 1])
// {
// cout << "The shortes smallest is: " << distances_vector[i] << "\nThe larger distance is: " << distances_vector[i - 1] << "\n";
// }
// else if (distances_vector[i] > distances_vector[i - 1])
// {
// cout << "The shortes smallest is: " << distances_vector[i - 1] << "\nThe larger distance is: " << distances_vector[i] << "\n";
// }
// }
// for (auto i : distances_vector)
// {
// sum_of_distance += i;
// }
// cout << "Sum of distances is: " << sum_of_distance << "\n";
// }
//
//
//}
//int main() //Guessing game
//{
// vector<int> numbers;
// vector<int> first_low_split;
// vector<int> second_low_split;
// vector<int> third_low_split;
// vector<int> fourth_low_split;
// vector<int> fifth_low_split;
//
// //*************************************
//
// vector<int> first_high_split;
// vector<int> second_high_split;
//
// string user_quess_input = "";
//
//
// for (int i = 1; i <= 100; i++)
// {
// numbers.push_back(i);
// }
//
//
// cout << "Is the number you are thinking of less than 50 ?\n";
// cin >> user_quess_input;
// if(user_quess_input == "yes")
// {
// first_low_split = { numbers.begin(), numbers.begin() + 49 };
// cout << "Is the number you are thinking of less than 25 ?\n";
// user_quess_input = "";
// cin >> user_quess_input;
// if (user_quess_input == "yes")
// {
// second_low_split = { first_low_split.begin(), first_low_split.begin() + 24 };
// cout << "Is the number you are thinking of less than 12 ?\n";
// user_quess_input = "";
// cin >> user_quess_input;
// if (user_quess_input == "yes")
// {
// third_low_split = { second_low_split.begin(), second_low_split.begin() + 11 };
// cout << "Is the number you are thinking of less than 6 ?\n";
// user_quess_input = "";
// cin >> user_quess_input;
// if (user_quess_input == "yes")
// {
// fourth_low_split = { third_low_split.begin(), third_low_split.begin() + 5 };
//
// cout << "Is the number you are thinking of less than 3 ?\n";
// user_quess_input = "";
// cin >> user_quess_input;
// if (user_quess_input == "yes")
// {
// fifth_low_split = { fourth_low_split.begin(), fourth_low_split.begin() + 2 };
// cout << "is 2 your number ?\n";
// user_quess_input = "";
// cin >> user_quess_input;
// if (user_quess_input == "yes")
// {
// cout << "You picked number 2\n";
// } else
// {
// cout << "You picked number 1\n";
// }
// }
// else if(user_quess_input == "no")
// {
// cout << "is 4 your number ?\n";
// user_quess_input = "";
// cin >> user_quess_input;
// if (user_quess_input == "yes")
// {
// cout << "You picked number 4\n";
// }
// else
// {
// cout << "You picked number 5\n";
// }
// }
// }
// }
// else if(user_quess_input == "no")
// {
//
// }
// }
// }
//
//}
// Number guessing game
//int main()
//{
// int number{ 50 };
//
// // define upper and lower bounds
// int upper{ 100 };
// int lower{ 1 };
// int range{ upper - lower };
// int half{ range / 2 };
//
// char answer{ '\0' };
// int question{ 0 };
//
// cout << "Think of a number between " << lower << " and " << upper << "\n\n";
// while (lower != upper)
// {
//
// range = upper - lower;
// if (range == 1 && number < half)
// {
// number = upper;
// }
// else if (range == 1 && number > half)
// {
// number = upper;
// }
// else
// number = lower + range / 2;
//
// //cout << "upper: " << upper << " lower: " << lower << " range: " << range << '\n';
//
// cout << question + 1 << ". Is the number you are thinking of less than " << number << "? (Enter 'y' or 'n') \n";
//
// cin >> answer;
// if ('y' == answer)
// {
// upper = number - 1;
// question++;
//
// }
// else if ('n' == answer)
// {
// lower = number;
// question++;
//
// }
// else
// {
// cout << "Please enter 'y' or 'n' ...\n";
// }
//
// //cout << "upper: " << upper << " lower: " << lower << " range: " << range << '\n';
//
// }
//
//
// cout << "The number you are thinking of is " << lower << "\n";
// cout << "I needed " << question << " guesses.\n";
//
// return 0;
//}
//using namespace std;
//int main()
//{
// double num_1 = 0, num_2 = 0, calculation_results = 0;
// char math_operator = 'as';
//
// cout << "Please enter two numbers followed by the operator you want the computer to perform on them: \n";
//
// while(cin >> num_1 >> num_2 >> math_operator)
// {
// switch (math_operator)
// {
// case '+':
// calculation_results = num_1 + num_2;
// cout << "The sum of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// case '-':
// calculation_results = num_1 - num_2;
// cout << "The minues of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// case '*':
// calculation_results = num_1 * num_2;
// cout << "The multipilication of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// case '/':
// calculation_results = num_1 / num_2;
// cout << "The divition of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// default:
// cout << "Please enter a valid operator!\n";
// break;
// }
//
// }
//
//}
//int main()
//{
// const vector<string> spelled_numbers = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"};
// int num_input = 0;
// string spelled_num;
// cout << "Please enter a number between 0 and 10 and also a number in string like two or five: \n";
// while(cin >> num_input >> spelled_num)
// {
// if(num_input <= 10)
// {
// for (int i = 0; i < spelled_numbers.size(); i++)
// {
// if (num_input == i)
// {
// cout << num_input << " is spelled " << spelled_numbers[i] << "\n";
// }
// if(spelled_num == spelled_numbers[i])
// {
// cout << "\n" << spelled_num << " is " << i;
// }
// }
// } else
// {
// cout << "Please enter a number between 0 and 10, for example 6!\n";
// }
//
// }
//}
//int turn_string_to_num(string num_input)
//{
// const vector<string> spelled_numbers = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"};
// int result = 0;
//
// if (find(spelled_numbers.begin(), spelled_numbers.end(), num_input) != spelled_numbers.end())
// {
// for (int i = 0; i < spelled_numbers.size(); i++)
// {
// if (num_input == spelled_numbers[i])
// {
// result = i;
// return result;
// }
// }
// result = stoi(num_input);
// return result;
// }
//
//
//}
//
//void do_math(int num_1, int num_2, char math_operator)
//{
// int calculation_results = 0;
// switch (math_operator)
// {
// case '+':
// calculation_results = num_1 + num_2;
// cout << "The sum of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// case '-':
// calculation_results = num_1 - num_2;
// cout << "The minues of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// case '*':
// calculation_results = num_1 * num_2;
// cout << "The multipilication of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// case '/':
// calculation_results = num_1 / num_2;
// cout << "The divition of " << num_1 << " and " << num_2 << " is equal to " << calculation_results << "\n";
// break;
// default:
// cout << "Please enter a valid operator!\n";
// break;
// }
//}
//
//int main()
//{
// int num1 = 0, num2 = 0;
// char math_operator = '0';
// string numbers_string_1, numbers_string_2;
//
// cout << "Please enter two numbers followed by the operator you want the computer to perform on them: \n";
//
// while (cin >> numbers_string_1 >> numbers_string_2 >> math_operator)
// {
//
// num1 = turn_string_to_num(numbers_string_1);
// num2 = turn_string_to_num(numbers_string_2);
// cout << num1 << "\t" << num2;
// if (num1 <= 10 && num2 <= 10 && num1 >= 0 && num2 >= 0)
// {
// do_math(num1, num2, math_operator);
// }
// else { cout << "Please enter a single digit number!\n"; }
//
// }
//}
//int main()
//{
// string players_pick;
// srand(time(0));
// int random_pick = rand() % 3;
// string pc_random_pic;
// vector<string> game_objects = { "rock", "paper", "sissor" };
// cout << "rock paper scissor, pick one!\n";
// while(cin >> players_pick)
// {
// pc_random_pic = game_objects[random_pick];
//
// if(players_pick == pc_random_pic)
// {
// cout << "DRAW! you and computer both picked " << players_pick << "\n";
// } else if(players_pick != pc_random_pic && players_pick == "rock" && pc_random_pic == "sissor")
// {
// cout << "You Win! " << "you picked '" << players_pick << "' which beats computer's pick '" << pc_random_pic << "'\n";
// }
// else if (players_pick != pc_random_pic && players_pick == "sissor" && pc_random_pic == "paper")
// {
// cout << "You Win! " << "you picked '" << players_pick << "' which beats computer's pick '" << pc_random_pic << "'\n";
// }
// else if (players_pick != pc_random_pic && players_pick == "paper" && pc_random_pic == "rock")
// {
// cout << "You Win! " << "you picked '" << players_pick << "' which beats computer's pick '" << pc_random_pic << "'\n";
// }
// else if (players_pick != pc_random_pic && players_pick == "sissor" && pc_random_pic == "rock")
// {
// cout << "You Lost! " << "you picked '" << players_pick << "' which is beaten by computer's pick '" << pc_random_pic << "'\n";
// }
// else if (players_pick != pc_random_pic && players_pick == "paper" && pc_random_pic == "sissor")
// {
// cout << "You Lost! " << "you picked '" << players_pick << "' which is beaten by computer's pick '" << pc_random_pic << "'\n";
// }