This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include "std_lib_facilities.h" | |
| int main() | |
| { | |
| /// name , age , school, why you choose com sci, hobbies | |
| std::cout << " introduction to my self " << "\n" | |
| << " ----------------------- " << "\n" | |
| << " hi my name is kryssel t de leon " << "\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| int main() | |
| { | |
| constexpr size_t n = 5; | |
| int arr[n] = {1, 2, 3, 4, 5}; | |
| int arr_2[n] = {1, 2, 8, 4, 5}; | |
| for(unsigned i = 0; i < n; ++i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main() | |
| { | |
| int ia[3][4] = { | |
| {0, 1 ,2 ,3}, | |
| {4, 5, 6, 7}, | |
| {8, 9, 10, 11} | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| int main() | |
| { | |
| std::vector<int> vec = {2 , 24, 1 , 3 ,5 ,6, 9, 11}; | |
| for (auto &v : vec) { | |
| ((v % 2) == 1) ? v += v : v = v; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <fstream> | |
| #include <sstream> | |
| #include <cstdlib> | |
| #include <bitset> | |
| int main() | |
| { | |
| std::string filename, savefile; | |
| std::string test; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> /// std::cout | |
| #include <vector> /// std::vector; std::endl; | |
| int main() | |
| { | |
| const std::vector<std::string> lgrade = {"F", "D", "C", "B", "A", "A++"}; | |
| const std::vector<std::string>::const_iterator igrade = lgrade.begin(); /// or std::begin() | |
| auto grades = 80; | |
| std::string lettergrade; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> /// std::cout | |
| #include <vector> /// std::vector; std::endl; | |
| int main() | |
| { | |
| const std::vector<std::string> lgrade = {"F", "D", "C", "B", "A", "A++"}; | |
| const std::vector<std::string>::const_iterator igrade = lgrade.begin(); /// or std::begin() | |
| auto grades = 80; | |
| std::string lettergrade; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <string> | |
| int main() | |
| { | |
| unsigned vowels = 0, consonants = 0, newline = 0, space = 0, tab = 0; | |
| std::string str; | |
| while (getline(std::cin,str)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| int main() | |
| { | |
| std::vector<std::string> vec; | |
| std::string s , word, prev; | |
| unsigned maxrepeats = 1, repeats = 1; | |
| while (std::cin >> s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| int main() | |
| { | |
| std::vector<int> vec1{0, 1, 1, 2}, vec2{0, 1, 1, 2, 3, 5, 8}; | |
| if(vec1.size() > vec2.size()) { | |
| for (auto it1 = vec2.begin(), it2 = vec1.begin(); it1 != vec2.end() && it2 != vec2.end(); ++it1, ++it2) { | |
| if (*it2 != *it1) { |