-
Fototrend

Ú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!
- FUJITSU LIFEBOOK U748 i5-8350u/8GB/256 GB SSD/14 " FHD IPS laptop
- Macbook Air 13" M2 2022 - 8 CPU, 10 GPU, 24GB / 512GB, 100% akku - garancia (109)
- Macbook Air 13" M2 - 2025 gyártás, 16GB RAM - ÚJ, aktiválatlan, Apple garancia (117)
- Intel I7 8700K / 16gb ddr4 / Rtx 2060
- HP ProBook 450 G5 I5-8250U 8 GB 256 GB NVMe 15,6" FullHD IPS laptop
- BESZÁMÍTÁS! EVGA XC3 ULTRA RTX 3070Ti 8GB videókártya garanciával hibátlan működéssel
- GYÖNYÖRŰ iPhone 15 Pro Max 256GB Blue Titanium-1 ÉV GARANCIA - Kártyafüggetlen, MS4240
- Asus laptop E1504F Ryzen 3
- Samsung PM9C1b 1TB M.2 PCIe Gen4 SSD! 7.100-6.700MB/s
- AKCIÓ! Lenovo Thinkpad L14 Gen 1 notebook - i5 10210U 16GB DDR4 512GB SSD Intel UHD GraphicsW11
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

