- 博客(4)
- 收藏
- 关注
原创 C#使用随机数生成元素不重复的数组
通过for与while的嵌套做了一个排除相同数字的审查机制,如果生成了数组中已有的数字就重新生成一个数字,继续循环排查,直到生成的数字是数组中不存在的数字数组长度不能超过随机数范围否则会死循环using System;namespace notRepeat{ class Program { static void Main(string[] args) { int[] vs = new int[10];//数组长度不能超过随机
2021-07-17 11:44:01
1688
原创 C#控制台输入一个正整数N,用*输出一个对应边长的菱形
C#控制台输入一个正整数N,用*输出一个对应边长的菱形,如输入3,输出using System;namespace diamond{ class Program { static void Main(string[] args) { bool z = true; while (z)//死循环 { Console.WriteLine("输入一个正整数
2021-07-15 19:29:02
2004
原创 C#入门控制台猜拳小游戏
采用if循环嵌套进行判断的一个控制台的猜拳游戏using System;namespace fg{ class Program { static void Main(string[] args) { bool i = true; int score = 10;//初始积分 while (i) { Console.WriteLi
2021-07-14 21:21:59
685
1
原创 杭电2084题数塔问题
初学代码,处理的不好的地方见谅,已经AC#include<stdio.h>#include<math.h> #define max(a,b)(((a)>(b))?(a):(b));//定义max函数int main(){ int x[100][100]; int a,b,i,j,n; scanf("%d",&a);//输入数塔的个数 while(a!=0) { a=a-1; scanf("%d",&b);//输入数塔的层数 f.
2020-05-26 23:29:27
246
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人