Skip to content

Instantly share code, notes, and snippets.

Giải bài tập của thầy Nguyễn Tấn Trần Minh Khang

Chương 1:

Bài 1: Tính S(n) = 1 + 2 + 3 + ... + n

Bài 2: Tính S(n) = 1^2 + 2^2 + ... + n^2

Bài 3: Tính S(n) = 1 + ½ + 1/3 + ... + 1/n

@vahavius
vahavius / bitsandpieces.sol
Created September 25, 2022 01:21 — forked from threepwave/bitsandpieces.sol
Bitwise Operations and Bit Manipulation
pragma solidity ^0.8.0;
contract BitsAndPieces {
// Source: https://medium.com/@imolfar/bitwise-operations-and-bit-manipulation-in-solidity-ethereum-1751f3d2e216
/* Bitwise operations / bit manipulation */
function and(bytes1 a, bytes1 b) internal returns (bytes1) {
return a & b;
}
@vahavius
vahavius / mydapp
Created September 18, 2022 02:00 — forked from ivelin/mydapp
NYU Dapp
pragma solidity ^0.4.17;
contract Auction {
// Data
//Structure to hold details of the item
struct Item {
uint itemId; // id of the item
uint[] itemTokens; //tokens bid in favor of the item
}
@vahavius
vahavius / Bai001...Bai001.sol
Created July 25, 2022 14:15
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
contract Bai001 {
uint256 m_nData;
function set(uint256 i_nData) public {
m_nData = i_nData;
}
function get() public view returns (uint256) {