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();
        }
    }
}

运行结果

相关推荐
荔枝吻14 分钟前
【AI总结】C#与.NET:一段跨越20年的命名纠葛与共生传奇
开发语言·c#·.net
波波0071 小时前
每日一题:请解释 .NET中的内存模型是什么
开发语言·c#·.net
眼眸流转2 小时前
LeetCode热题100(七)
算法·leetcode·c#
格林威2 小时前
工业相机图像采集处理:从 RAW 数据到 AI 可读图像,附海康相机 C++实战代码
开发语言·c++·人工智能·数码相机·计算机视觉·c#·工业相机
需要点灵感3 小时前
# 从身份证读卡到钉钉同步:C# WinForms企业级应用开发实战
开发语言·c#·钉钉
SunnyDays10113 小时前
使用 C# 实现 Word 转 Excel并保留格式(只需三步)
c#·word 转 excel·docx转xlsx·doc转xlsx·word 表格转 excel
码路星河3 小时前
SpringBoot3实战:优雅实现Word文档动态生成与下载
开发语言·c#·word
Eiceblue4 小时前
通过 C# 读取 Word 表格数据:高效解析 + 导出为 CSV/TXT
开发语言·c#·word
格林威4 小时前
工业相机图像采集处理:从 RAW 数据到 AI 可读图像,堡盟相机 C#实战代码深度解析
c++·人工智能·数码相机·opencv·算法·计算机视觉·c#
夏霞12 小时前
c# signlar 客户端传递参数给服务端配置方法
开发语言·c#