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
use std::io; | |
fn patterns()->i32{ | |
println!("please enter your age:"); | |
let mut age = String::new(); | |
io::stdin().read_line(&mut age).expect("invalid input"); | |
let age_num:i32=match age.trim().parse(){ | |
Ok(num)=>num, | |
Err(_)=>{ | |
println!("no input"); |
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
//SPDX-License-Identifier-MIT | |
pragma solidity ^ 0.8.4; | |
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"; | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal pure returns (uint256) { | |
if (a == 0) { | |
return 0; | |
} |
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.3; | |
contract MyMultiSig{ | |
event Deposit(address indexed sender,uint amount,uint balance); | |
event SubmitTransaction ( | |
address indexed owner, | |
uint indexed txIndex, | |
address indexed to, | |
uint value, |