Thread Rechenproblem (8 answers)
Opened by bianca at 2011-05-15 16:08

GwenDragon
 2011-05-15 16:37
#148625 #148625
User since
2005-01-17
14563 Artikel
Admin1
[Homepage]
user image
Ich hoffe ich verstehe deine Aufgabenstellung richtig.

Probier mal das:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
my $max = 10;
my $anzahl = 30;

my $add = int ($anzahl / $max);
my $lfd = 1;
foreach my $nr (1..$anzahl) {
        last if $nr > 10;
        print "Nr. $nr kommt rein, Anzeige Nr. $lfd\n";
        $lfd += $add;
}
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread Rechenproblem