Hirdetés
-
PROHARDVER!

Új hozzászólás Aktív témák
-
Zola007
veterán
Ezt meg lehet rövidebben vagy kevesebb változóval oldani (Perl 5.24)?
#!/usr/bin/perl -w
# Write a program that switches two bases in a DNA string at specified positions.
# Get the name of the file with the DNA sequence data
print "Please type in the sequence need to be modified: ";
$DNA = <STDIN>;
# Remove the newline
chomp $DNA;
# Get the base would like to change
print "Please type in which positions would like to switch?\n";
print " This position: ";
$pos1 = <STDIN>;
print "\n to this one: ";
$pos2 = <STDIN>;
# Remove the newline
chomp $pos1;
chomp $pos2;
# detect the bases at given positions to be modified
$base1= substr $DNA,($pos1 - 1),1;
$base2= substr $DNA,($pos2 - 1),1;
# change the bases among each other
$swap = substr $DNA,($pos1 - 1),1,$base2;
$swap = substr $DNA,($pos2 - 1),1,$base1;
print "The modified sequence is ",$DNA;
exit;
Új hozzászólás Aktív témák
● olvasd el a téma összefoglalót!
- Samsung Galaxy S23 és S23+ - ami belül van, az számít igazán
- Yettel topik
- Motorolaj, hajtóműolaj, hűtőfolyadék, adalékok és szűrők topikja
- Android alkalmazások - szoftver kibeszélő topik
- Elképzelhetetlen sebességre kapcsol Jeff Bezos űrinternete
- Milyen légtisztítót vegyek?
- Motoros topic
- Samsung LCD és LED TV-k
- MasterDeeJay: Ram gondolatok 2026 január - DDR3-as gép is lehet megoldás? Mi a minimum?
- Milyen monitort vegyek?
- További aktív témák...
- Panasonic LUMIX G 25mm f/1.7 ASPH objektív
- Apple iPhone 12 Pro 128GB, Kártyafüggetlen, 1 Év Garanciával
- LG 27GR95UM - 27" MiniLED - UHD 4K - 160Hz 1ms - NVIDIA G-Sync - FreeSync Premium PRO - HDR 1000
- BESZÁMÍTÁS! MSI B450M R5 5500 16GB DDR4 512GB SSD RTX 2060 6GB Rampage SHIVA Cooler Master 650W
- Csere-Beszámítás! Lenovo Ideapad Gaming 3 Laptop! I5 12450H / RTX 3050 / 16GB DDR4 / 512+256 SSD
Állásajánlatok
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Cég: Laptopműhely Bt.
Város: Budapest



