Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Mennyi 6789^8642 és 6789^8679 utolsó két számjegye?
- # utolso 2 szamjegy --> mod 100
- sub keres($$$) {
- ($x, $ad, $mod) = @_;
- # x^1:
- $temp = $x % $mod;
- # x^2 .. ad:
- foreach (2 .. $ad) {
- $temp *= $x;
- $temp %= $mod;
- }
- print "$temp\n";
- }
- keres(6789, 8642, 100);
- keres(6789, 8679, 100);
- # >hatvany_utso2.pl
- # 21
- # 9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement