Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Swift func with variable number of parameters
applehelpwriter
Jun 4th, 2014
764
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Objective C
0.20 KB
| None
|
0
0
raw
download
clone
embed
print
report
//swift
//variable number of parameters
func sumOf
(
numbers
:
Int...
)
-
> Int
{
var sum
=
0
for
number
in
numbers
{
sum
+=
number
}
return
sum
}
sumOf
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
)
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
Free Crypto Method
CSS | 13 min ago | 0.94 KB
+27,000$ in 3 days
CSS | 14 min ago | 0.94 KB
Fast Track to $25K in 72 Hours
CSS | 29 min ago | 0.91 KB
Hidden Cyrpto Opportunity
CSS | 29 min ago | 0.91 KB
Untitled
1 hour ago | 13.54 KB
Untitled
1 hour ago | 7.72 KB
Untitled
3 hours ago | 20.09 KB
Untitled
5 hours ago | 9.62 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!