C#:while循环

任务描述

过年的时候,朋友家人聚在一起经常玩个活动。比如玩扑克牌,扑克牌有多种玩法,但一般起牌的时候会按照某种序列拿在手中,有的人喜欢从大到小,有的人喜欢从小到大。

任务要求,扑克牌的牌面是从1-13,按照编程要求,使用while循环和冒泡排序从小到大将混乱的牌面重新

测试说明

测试过程:

平台将编译用户补全后代码,并根据程序的输出判断程序是否正确。

以下是测试样例:

测试输入:

预期输出:

1

2

3

4

5

6

7

8

9

10

11

12

13

排列。

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace F1

{

class Program

{

static void Main(string\[\] args)

{

//int\[\] array = { 1, 2, 6, 9, 4, 7, 13, 12, 5, 3, 8, 10, 11 };

/********** Begin *********/

int i = 0;

while (i <= 12)

{

i++;

Console.WriteLine("" + i);

}

/********** End *********/

// int size = 0;

// while (size < array.Length)

//{

// Console.WriteLine(arraysize);

// size++;

// }

}

}

}

相关推荐
隐积3 小时前
3.1.7.Qt容器大家族(3):QVariant——万能盒子
开发语言·qt
名字还没想好☜6 小时前
Next.js ‘use client‘ 到底加在哪:Server/Client Components 边界与常见报错
开发语言·前端·javascript·react·next.js
初级代码游戏7 小时前
iOS开发 Swift 速记1:变量和基本数据类型
开发语言·ios·swift
海盗12347 小时前
微软技术周报 ——2026-08-03
后端·python·microsoft·c#·.netcore
酷在前行8 小时前
【R生态】PERMANOVA 进阶实战:距离选择、PERMDISP、两两比较与受限置换(保姆级教程)
开发语言·r语言
cxr8288 小时前
Graphify vs GitNexus vs CodeGraph — 三工具架构深度对比
开发语言·架构·知识图谱
废弃的小码农9 小时前
功能测试--Day07--Python编程基础
开发语言·python
fengci.10 小时前
Microweber CMS 未授权路径穿越漏洞(CVE-2026-65694)
android·开发语言·前端·学习·php
程序员zgh10 小时前
C++ 拷贝赋值运算符 详解
c语言·开发语言·c++
念何架构之路10 小时前
restartmanager-重启管理子系统
java·开发语言