This file contains 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 <math.h> | |
using namespace std; | |
bool is_prime(int n) { | |
if (n <= 1) return false; | |
if (n <= 3) return true; | |
if (n % 2 == 0 || n % 3 == 0) return false; | |
for (int i = 5; i * i <= n; i += 6) | |
if (n % i == 0 || n % (i + 2) == 0) return false; |
This file contains 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> | |
using namespace std; | |
int main() { | |
ifstream EncodeFile("encode.jpg", ifstream::binary); | |
ofstream DecodeFile("decode.jpg", ofstream::binary); | |
if (EncodeFile) { | |
EncodeFile.seekg (0, EncodeFile.end); |
This file contains 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
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H* |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<div id="container"> | |
<div class="select"> | |
<label for="audioSource">Audio source: </label> | |
<select id="audioSource"></select> |
This file contains 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> | |
#include <vector> | |
using namespace std; | |
class Item { | |
protected: | |
string ten; | |
public: |
This file contains 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> | |
#include <iomanip> | |
using namespace std; | |
int lookup[100][100]; | |
// Đổ dữ liệu cho mảng lookup bằng cách tìm độ dài của dãy con chung | |
int LCSLength(string s1, string s2, int l1, int l2) { | |
// Hàng đầu tiên và cột đầu tiên của mảng lookup bằng 0 vì mảng lookup đã được khai báo toàn cục |
This file contains 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
Function BinarySearch(strArray() As String, strSearch) As Long | |
Dim Left As Long, Middle As Long, Right As Long | |
Left = 1 | |
Right = UBound(strArray, 1) | |
Do While Left <= Right | |
Middle = Left + (Right - Left) / 2 | |
If strSearch = strArray(Middle, 1) Then | |
BinarySearch = Middle |
NewerOlder