passer au contenu principal
paste
bin
.ca
type · paste · share
⌘
K
Se connecter
?
Compte
Plus
▾
Docs
Famille
La famille bin
pastebin.ca
pôle
Share text and code with expiry and privacy controls.
imagebin.ca
Upload and share images with direct links.
filebin.ca
Drop a file and get a shareable link.
notebin.ca
Write Markdown notes with durable links.
turl.ca
Short, reputation-checked links.
attn.ca
Notifications and alerts for your services.
voicebin.ca
Record and share short voice clips.
dnsbin.ca
Inspect DNS and debug records.
← retour au collage
›
Modifier / dupliquer
Collage sans titre
#2vFJvYEQrB
public / public
nouvelle version
anonyme
créé 2 days ago
Expire dans 5 days
1.7 KB
syntaxe:
text
Vos changements créent un nouveau collage lié à celui-ci — l’original reste intact.
nouvelle version
Vos changements créent un nouveau collage lié à celui-ci — l’original reste intact.
Titre (facultatif)
Nom de fichier
Syntaxe
text
text
bash
c
cpp
css
diff
dockerfile
go
html
ini
java
javascript
json
kotlin
lua
makefile
markdown
nginx
php
python
ruby
rust
shellscript
sql
swift
toml
typescript
xml
yaml
Visibilité
Fil public
Accès
public
Expire
7 jours
10 min
1 heure
1 jour
7 jours
30 jours
90 jours
personnalisé…
Expiration personnalisée
Note de changement
(facultatif)
Tout le monde peut trouver ce collage dans le fil public. Choisissez Non répertorié pour le partager uniquement par lien.
Créer une nouvelle version
Annuler
Collez ou tapez…
# estimate.py —— 数制转换与存储容量估算验证脚本 # 单位约定:1 MB = 10^6 B,1 MiB = 2^20 B,1 GB = 10^9 B,1 GiB = 2^30 B def show_num_systems(): print("=== 一、数制转换验证 ===") b = '10110101' print(f"int('{b}', 2) = {int(b, 2)}") # 期望 181 print(f"hex(255) = {hex(255)}") # 期望 0xff print(f"bin(0x1A) = {bin(0x1A)}") # 期望 0b11010 print(f"int('1A', 16) = {int('1A', 16)}") # 期望 26 def photo_size(w=1920, h=1080, depth=24): bits = w * h * depth bytes_ = bits / 8 return bits, bytes_, bytes_ / 1e6, bytes_ / 2**20 def audio_size(minutes=4, sr=44100, bits=16, ch=2): seconds = minutes * 60 bits_total = sr * bits * ch * seconds bytes_ = bits_total / 8 return bits_total, bytes_, bytes_ / 1e6, bytes_ / 2**20 def video_size(hours=2, mbps=8): seconds = hours * 3600 bits_total = mbps * 1e6 * seconds bytes_ = bits_total / 8 return bits_total, bytes_, bytes_ / 1e9, bytes_ / 2**30 def iphone_shot_size(w=2868, h=1320, depth=24): bits = w * h * depth bytes_ = bits / 8 return bits, bytes_, bytes_ / 1e6, bytes_ / 2**20 def report(name, bits, bytes_, dec, bin_): print(f"\n{name}: {bits:,} bit = {bytes_:,.0f} B " f"≈ {dec:.2f} MB/GB ≈ {bin_:.2f} MiB/GiB") if __name__ == '__main__': show_num_systems() print("\n=== 二、存储容量估算 ===") report("1920×1080×24bit 未压缩照片", *photo_size()) report("4分钟 44.1kHz/16bit 双声道音频", *audio_size()) report("2小时 8Mbps 视频", *video_size()) report("iPhone 16 Pro Max 截图 2868×1320×24bit 未压缩", *iphone_shot_size())