// Playground - noun: a place where people can play import UIKit //------------------------------------------------------------------------------ // 1. for // 传统的for循环方式在swift中同样支持 var num = 0 for(var i = 0; i < 10 ; i++) { num += i } num //---------
// Playground - noun: a place where people can play import UIKit //------------------------------------------------------------------------------ // 1. for // 传统的for循环方式在swift中相同支持 var num = 0 for(var i = 0; i < 10 ; i++) { num += i } num //---------
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { //声明数组. 第一种方法. 声明并分配元素大小. int[] Myint = new int[30]; Myint[0] = 30; Myint[1] = 50;