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++;

// }

}

}

}

相关推荐
哥不想学算法2 小时前
【C++】字符串字面量拼接
开发语言·c++
gugucoding4 小时前
21. 【C语言】打包不同类型:结构体
c语言·开发语言
Brookty4 小时前
【JavaEE】线程安全(一).4:写块串行保安全、CAS
java·开发语言·java-ee·多线程·线程安全
F20226974864 小时前
西门子 PLC 与 C# 通信
开发语言·c#
gugucoding5 小时前
31. 【C语言】堆栈与队列的实现
c语言·开发语言·数据结构·链表
万联WANFLOW6 小时前
多分支企业组网,IP 网段到底该怎么规划
开发语言·php
阿里嘎多学长6 小时前
2026-07-07 GitHub 热点项目精选
开发语言·程序员·github·代码托管
cookies_s_s7 小时前
C++ 字符串动态创建对象 -- 工厂模式、自动注册、模板递归动态调用
服务器·开发语言·c++
盐焗鹌鹑蛋8 小时前
【C++】继承
开发语言·c++