C# 循环

C#循环

代码

csharp 复制代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Test
    {
        static void Main(string[] args)
        {
            int a = 5;
            int[] b = { 1, 2, 3, 4, 5, 6, 7, 8 };
            int c = 0;
            for (int i = 0; i < a; i++)
            {
                Console.WriteLine("i:" + i);
            }
            foreach (var item in b)
            {
                Console.WriteLine("b[" + c++ +"]:" + item);
            }
            Console.ReadLine();
        }
    }
}

运行结果

相关推荐
格林威1 小时前
ZeroMQ 在视觉系统中的应用
开发语言·人工智能·数码相机·机器学习·计算机视觉·c#·视觉检测
格林威1 小时前
工业相机图像采集:如何避免多相机数据混乱
人工智能·数码相机·opencv·机器学习·计算机视觉·c#·视觉检测
武藤一雄1 小时前
C#万字详解 栈与托管堆 的底层逻辑
windows·microsoft·c#·.net·.netcore
山檐雾2 小时前
C#泛型缓存
缓存·c#
追雨潮2 小时前
内存向量检索引擎设计与实现:C# 轻量级 Milvus 替代方案
开发语言·c#·milvus
大空大地20262 小时前
LINQ数据访问技术
c#·linq
武藤一雄2 小时前
深入拆解.NET内存管理:从GC机制到高性能内存优化
windows·microsoft·c#·.net·wpf·.netcore·内存管理
江沉晚呤时2 小时前
深入理解 Akka.NET:高并发与分布式系统的利器
开发语言·c#·.net
格林威3 小时前
GigE Vision 多相机同步优化方案: PTP + 硬件触发 + 时间戳对齐
c++·人工智能·数码相机·计算机视觉·c#·视觉检测·工业相机
江沉晚呤时3 小时前
C# 高级多态揭秘:从虚函数表到性能优化实战
开发语言·c#·.net