Pure Programmer
Blue Matrix


Cluster Map

Selection

L1

This page is under construction. Please come back later.

Selection1.swift
#!/usr/bin/env swift;
import Foundation

func main() -> Void {
	print("Start...")
	if CommandLine.arguments.count != 3 {
		print("You need at least two command line arguments!")
	}
	print("Finish...")
	exit(EXIT_SUCCESS)
}
main()

Output
Start... You need at least two command line arguments! Finish... Start... Finish...
Selection2.swift
#!/usr/bin/env swift;
import Foundation
import Utils

func main() -> Void {
	let x:Int = Int(CommandLine.arguments[1]) ?? 0
	print("Start...")
	if x > 10 {
		print("Greater than 10")
	} else {
		print("Less than or equal to 10")
	}
	print("Finish...")
	exit(EXIT_SUCCESS)
}
main()

Output
Start... Less than or equal to 10 Finish... Start... Greater than 10 Finish...
Selection3.swift
#!/usr/bin/env swift;
import Foundation
import Utils

func main() -> Void {
	let x:Int = Int(CommandLine.arguments[1]) ?? 0
	print("Start...")
	if x > 1000 {
		print("Greater than 1000")
	} else if x > 100 {
		print("Greater than 100 but less than or equal to 1000")
	} else {
		print("Less than or equal to 100")
	}
	print("Finish...")
	exit(EXIT_SUCCESS)
}
main()

Output
Start... Less than or equal to 100 Finish... Start... Greater than 100 but less than or equal to 1000 Finish... Start... Greater than 1000 Finish...
Selection4.swift


 
  
   Error 500 - Internal server error
  
  
  
 
 
  

Error 500 - Internal server error

An internal server error has occured!
Please try again later.

Output
Error 500 - Internal server error

Error 500 - Internal server error

An internal server error has occured!
Please try again later.

Selection5.swift


 
  
   Error 500 - Internal server error
  
  
  
 
 
  

Error 500 - Internal server error

An internal server error has occured!
Please try again later.

Output
Error 500 - Internal server error

Error 500 - Internal server error

An internal server error has occured!
Please try again later.

swift

Questions

Projects

More ★'s indicate higher difficulty level.

References