1
0
Fork 0

Practikal Informatiques

This commit is contained in:
Nguyễn Gia Phong 2018-12-26 11:52:05 +07:00
parent 8d090c241f
commit d0ce1ee82b
35 changed files with 55 additions and 0 deletions

0
12/TP-HN-2008/R1/BL1.PAS Executable file → Normal file
View File

0
12/TP-HN-2008/R1/BL2.PAS Executable file → Normal file
View File

0
12/TP-HN-2008/R1/BL3.PAS Executable file → Normal file
View File

0
12/TP-HN-2008/R1/BL4.pas Executable file → Normal file
View File

0
12/TP-HN-2008/R1/CLB.IN Executable file → Normal file
View File

0
12/TP-HN-2008/R1/CLB.OU Executable file → Normal file
View File

0
12/TP-HN-2008/R1/R1.DOC Executable file → Normal file
View File

0
12/TP-HN-2008/R2/tbc.pas Executable file → Normal file
View File

0
12/TP-HN-2009/R1/BTN.PAS Executable file → Normal file
View File

0
12/TP-HN-2009/R1/HEXA.PAS Executable file → Normal file
View File

0
12/TP-HN-2009/R1/PS.PAS Executable file → Normal file
View File

0
12/TP-HN-2009/R2/BAI1.PAS Executable file → Normal file
View File

0
12/TP-HN-2009/R2/BAI3.PAS Executable file → Normal file
View File

0
12/TP-HN-2010/BAI1.PAS Executable file → Normal file
View File

0
12/TP-HN-2010/BAI2.PAS Executable file → Normal file
View File

0
12/TP-HN-2010/BAI3 Executable file → Normal file
View File

0
12/TP-HN-2010/BAI3.INP Executable file → Normal file
View File

0
12/TP-HN-2010/BAI3.OUT Executable file → Normal file
View File

0
12/TP-HN-2010/BAI3.o Executable file → Normal file
View File

0
12/TP-HN-2010/BAI3.pas Executable file → Normal file
View File

0
12/TP-HN-2010/TP-2010.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

0
12/TP-ThanhHoá-2009/bai4.py Executable file → Normal file
View File

0
12/TP-ThanhHoá-2009/bai4pas_srcgen.py Executable file → Normal file
View File

0
NTU/hamar.py Executable file → Normal file
View File

0
NTU/sagain_geninp.py Executable file → Normal file
View File

0
THT/B/QG-2014/DIC.DAT Executable file → Normal file
View File

0
THT/B/QG-2014/sample.pas Executable file → Normal file
View File

0
THT/B/QG-2016/remainder.py Executable file → Normal file
View File

0
THT/B/QG-2016/trigrid.py Executable file → Normal file
View File

0
THT/C/Q-2016/bai2.py Executable file → Normal file
View File

0
THT/C/Q-2016/bai3.py Executable file → Normal file
View File

0
THT/C/QG-2017/ImgViewer.exe Normal file → Executable file
View File

0
THT/C/QG-2017/xxiii.py Executable file → Normal file
View File

View File

@ -979,3 +979,13 @@ lớn nhất.
| VDD.INP | VDD.OUT |
| ---------------------------------------------------------------------- | :-----: |
| 5 1 5<br>0 0 0 1 1<br>0 0 0 0 1<br>1 1 0 0 1<br>1 1 0 0 0<br>0 1 0 0 0 | 2 |
## Số chữ số chính phương
Viết chương trình in ra số lượng số chính phương có `n` chữ số.
### Ví dụ
| stdin | stdout |
| :---: | :----: |
| 2 | 6 |

View File

@ -84,3 +84,48 @@ sub estimate-pi {
1 / $factor / Srinivasa-Ramanujan
}
#put abs estimate-pi() - pi;
sub ducks { map * ~ 'ack' , flat('J'..'N', 'Ou', 'P', 'Qu') }
#put ducks;
sub count(Str $string, Str $substr, Int $index = 0, Int $result = 0) {
my $i = index $string, $substr, $index;
return $result if $i === Any;
count $string, $substr, $i + 1, $result + 1
}
#put count 'banana', 'na';
sub bubble-sort(@seq is copy) {
my $done;
repeat {
$done = True;
for ^(@seq.elems - 1) -> $i {
if @seq[$i] > @seq[$i+1] {
(@seq[$i], @seq[$i+1]) = @seq[$i+1], @seq[$i];
$done = False
}
}
} until $done;
@seq
}
#put bubble-sort <4 2 6 5 3 9 1>;
sub select-sort(@seq is copy) {
for ^(@seq.elems - 1) -> $i {
for $i..^@seq.elems -> $j {
(@seq[$i], @seq[$j]) = @seq[$j], @seq[$i] if @seq[$i] > @seq[$j]
}
}
@seq
}
#put select-sort <4 2 6 5 3 9 1>;
sub insert-sort(@seq is copy) {
for 1..^@seq.elems -> $i {
loop (my $j = $i; $j and @seq[$j] < @seq[$j - 1]; $j--) {
(@seq[$j], @seq[$j - 1]) = @seq[$j - 1], @seq[$j]
}
}
@seq
}
#put insert-sort <4 2 6 5 3 9 1>;