pular para o conteúdo principal
paste
bin
.ca
type · paste · share
⌘
K
Entrar
?
Conta
Mais
▾
Docs
Família
A família bin
pastebin.ca
central
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.
← voltar para a publicação
›
Editar / bifurcar
Publicação sem título
#2vFJvYEQrB
public / public
nova versão
anônimo
criado 2 days ago
Expira em 5 days
1.7 KB
sintaxe:
text
Suas alterações criam uma nova publicação vinculada a esta — a original não é alterada.
nova versão
Suas alterações criam uma nova publicação vinculada a esta — a original não é alterada.
Título (opcional)
Nome do arquivo
Sintaxe
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
Visibilidade
Feed público
Acesso
public
Expira
7 dias
10 min
1 hora
1 dia
7 dias
30 dias
90 dias
personalizada…
Expiração personalizada
Nota da alteração
(opcional)
Qualquer pessoa pode encontrar esta publicação no feed público. Escolha Não listada para compartilhá-la apenas por link.
Criar nova versão
Cancelar
Cole ou digite…
# 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())