创意电子

标题: 通过C#编程实现递归算法的完备源代码 [打印本页]

作者: 什来之比    时间: 2021-10-5 10:27
标题: 通过C#编程实现递归算法的完备源代码
基于视频解说的通过C#编程实现递归算法源代码,复制可用无需更改,明白递归算法:
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication4{    public partial class Form1 : Form    {        private string str = null;        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            int a;            if(int.TryParse(textBox1.Text,out a))            {                textBox2.Text = GetArithmetic(a).ToString();                                textBox3.Text = str;                           }            else            {                MessageBox.Show("请输入正确的数字");            }        }        int GetArithmetic(int i)        {            str = str + i + ",";            if (i
作者: 什来之比    时间: 2021-10-5 12:12
代码完整
作者: 乐娱a    时间: 2021-10-5 20:21
转发了
作者: 刀客觅知音    时间: 2021-10-5 22:45
[赞]




欢迎光临 创意电子 (https://www.wxcydz.cc/) Powered by Discuz! X3.4