技术栈

C# 循环

1314lay_10072024-03-19 11:52

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

运行结果

上一篇:pytorch升级打怪(六)
下一篇:Go程序设计语言 学习笔记 第一章 入门
相关推荐
阿蒙Amon
3 小时前
C#每日面试题-Thread.Sleep和Task.Delay的区别
java·数据库·c#
cfqq1989
4 小时前
Settings,变量保存
开发语言·c#
云草桑
5 小时前
.net AI开发04 第八章 引入RAG知识库与文档管理核心能力及事件总线
数据库·人工智能·microsoft·c#·asp.net·.net·rag
曹牧
7 小时前
C#:窗体构造函数无法引用窗体控件
开发语言·c#
iAkuya
7 小时前
(leetcode)力扣100 54实现Trie树
算法·leetcode·c#
xb1132
7 小时前
C#使用Cancellation来取消异步任务
开发语言·c#
m0_74822999
7 小时前
C与C#:编程语言的核心差异解析
c语言·开发语言·c#
m0_74822999
8 小时前
Laravel7.x核心特性全解析
c语言·数据库·c#
阿蒙Amon
8 小时前
C#每日面试题-Task和Thread的区别
java·面试·c#
ytttr873
10 小时前
C#实现海康威视智能车牌识别
开发语言·c#
热门推荐
01GitHub 镜像站点02OpenCode 入门教程:介绍 · 安装 · 配置第三方 API (如 Claude)03Clawdbot 中文汉化版 接入微信、飞书04一种新的LCA算法05【网络安全测试】Burp Suite工具使用说明、配置及常见问题(有关必回)06Claude Code Skills 实用使用手册07在Trae中使用Pencil MCP08零门槛部署本地 AI 助手:Clawdbot/Meltbot 部署深度保姆级教程09struts2 XML外部实体注入漏洞复现(CVE-2025-68493)10UV安装并设置国内源