Új hozzászólás Aktív témák
-
bambano
titán
a postgresql mindenre jó kategória indulója:
tmp=> \d fibonacci
Table "public.fibonacci"
Column | Type | Modifiers
--------+---------+-------------------------------------------------------
n | bigint | not null default nextval('fibonacci_n_seq'::regclass)
fib | numeric |psql -d tmp -c "insert into fibonacci (fib) \
select f1.fib+f2.fib from fibonacci f1, fibonacci f2 \
where f1.n=(select last_value from fibonacci_n_seq ) and \
f2.n=(select last_value-1 from fibonacci_n_seq );" -
bambano
titán
Tehát az én bash+linux megoldásom:
#! /bin/bash
( tail -2 fibonacci.txt | head -1 | tr -d '\n'
echo -n '+'
tail -1 fibonacci.txt ) | bc | \
sed -e 's/\\$//' | tr -d '\n' | tee -a fibonacci.txt
printf "\n">>fibonacci.txt
printf "\n"
Új hozzászólás Aktív témák
- Acer Nitro ANV16-41 16" FullHD 165Hz - Ryzen 8645HS - 32GB/1TB - RTX 4050
- Asztali PC , R5 5500 , RX 5700 XT , 16GB RAM , 512GB NVME
- Thinkpad T14 Gen2i 14" FHD IPS i5-1145G7 16GB 256GB NVMe SSD gar
- iPhone 16 Pro Max 256GB Desert Titanium 98% akkuval!
- iPhone 16 Plus 128GB Ultramarine Karcmentes, 100% akkuval!
- AKCIÓ! HP Elitebook 840 G11 üzleti notebook- Intel Core Ultra 5 135U 16GB DDR5 RAM 256GB SSD W11
- Google Pixel 10 Pro XL Moonstone Super Actua 120 Hz, Pro kamera 5 zoom 256 GB Használt,Gari
- GYÖNYÖRŰ iPhone 13 mini 128GB Starlight -1 ÉV GARANCIA -Kártyafüggetlen, MS3610
- Telefon felvásárlás!! iPhone 15/iPhone 15 Plus/iPhone 15 Pro/iPhone 15 Pro Max
- HIBÁTLAN iPhone 13 128GB Starlight -1 ÉV GARANCIA - Kártyafüggetlen, MS3432
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest