hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Valuation

 
Reply to topic    hacker.org Forum Index » Challenges View previous topic
View next topic
Valuation
Author Message
Sairera



Joined: 07 Nov 2010
Posts: 6

Post Valuation Reply with quote
I am trying to do this challenge in Perl, because I am taking a Perl class and it just makes sense for me to try it in this language, so here's what I've got:
#!/usr/bin/perl
#valuation.plx
use warnings;

@numbers = (9,3,7,5,2,,,,7,4,6,,2,7,,1,7,5,4,,,9,0,,9,3,,,,,,2,3,8,,4,4,,7,5,,,0,8,7,5,0,9,1,2,7,3,8,,8,4,6,1,,8,7,5,9,3,8,3,,,3,2,8,,4,,4,9,3,5,9,0,3,,6,,5,5,5,0,3,6,0,5,3,5,0,0,4,,0,,,9,4,5,9,5,8,9,6,1,2,9,6,,2,6,7,,8,8,4,2,,,,5,,6,,,6,1,,4,,4,8,4,8,2,,8,0,,,,8,3,3,1,6,8,4,3,,7,,4,,8,3,,9,5,2,1,7,3,1,,,,2,5,,5,1,,,4,5,7,,6,,5,,9,6,9,8,2,2,2,,7,7,1,2,3,7,7,4,5,0,3,4,,5,1,3,3,5,9,2,,2,7,,,8,,8,7,,,3,5,2,2,1,,3,6,,0,,5,0,,2,3,,7,,6,3,,9,9,8,4,1,8,,);
my $sum = 0;
for (@numbers) {
$sum += $_;
}
print "$sum\n";

I took out the x's so I could make sure the adding works, and it did. What I need to know now is how to deal with the x's. Can anyone help?
Thu Oct 04, 2012 10:22 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Challenges All times are GMT
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.