|
|
@@ -8,28 +8,40 @@ int main()
|
|
|
// test_char();
|
|
|
// rotate();
|
|
|
// test_func();
|
|
|
- int num;
|
|
|
- std::cout << "Input a num to check if it's prime num:\n> ";
|
|
|
- std::cin >> num;
|
|
|
- printf(isPrimeNum(num)?"Yes\n":"No\n");
|
|
|
+ // int num;
|
|
|
+ // std::cout << "Input a num to check if it's prime num:\n> ";
|
|
|
+ // std::cin >> num;
|
|
|
+ // printf(isPrimeNum(num)?"Yes\n":"No\n");
|
|
|
|
|
|
- int a = 3, b = 87;
|
|
|
- std::cout << "A is " << a << " and B is " << b << std::endl;
|
|
|
- swap(a, b);
|
|
|
- std::cout << "A is " << a << " and B is " << b << std::endl;
|
|
|
- char c = 'c', d = 'd';
|
|
|
- std::cout << "C is " << c << " and D is " << d << std::endl;
|
|
|
- swap(c, d);
|
|
|
- std::cout << "C is " << c << " and B is " << d << std::endl;
|
|
|
+ //////////////////////
|
|
|
+ // Reference parameter
|
|
|
+ //
|
|
|
+ // int a = 3, b = 87;
|
|
|
+ // std::cout << "A is " << a << " and B is " << b << std::endl;
|
|
|
+ // swap(a, b);
|
|
|
+ // std::cout << "A is " << a << " and B is " << b << std::endl;
|
|
|
+ // char c = 'c', d = 'd';
|
|
|
+ // std::cout << "C is " << c << " and D is " << d << std::endl;
|
|
|
+ // swap(c, d);
|
|
|
+ // std::cout << "C is " << c << " and B is " << d << std::endl;
|
|
|
|
|
|
- something gg("Man", "Human", 228);
|
|
|
- gg.add_value(16);
|
|
|
- gg.add_value(8);
|
|
|
- std::cout << gg.name << std::endl;
|
|
|
- std::cout << "Value list:" << std::endl;
|
|
|
- for (int v : gg.value_list)
|
|
|
+ ///////////////
|
|
|
+ // Trying Class
|
|
|
+ //
|
|
|
+ YoutubeChannel gg("C++ tutorial", "Lzl", 0);
|
|
|
+ gg.pub_video("C++ for beginners 1");
|
|
|
+ gg.pub_video("C++ for beginners 2");
|
|
|
+ gg.show_info();
|
|
|
+ for (int subs=0; subs<98; subs++)
|
|
|
{
|
|
|
- std::cout << v << std::endl;
|
|
|
+ gg.subscribe();
|
|
|
}
|
|
|
+ gg.show_info();
|
|
|
+ for (int unsubs=0; unsubs<15; unsubs++)
|
|
|
+ {
|
|
|
+ gg.unsubscribe();
|
|
|
+ }
|
|
|
+ gg.show_info();
|
|
|
+
|
|
|
return 0;
|
|
|
}
|