我是初学者 [英] I'm a beginner

查看:67
本文介绍了我是初学者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在单个变量中输入多个值。

I want to know how I can enter more than one value in a single variable.

推荐答案

单个变量只能容纳一个变量。时间 也许您正在寻找结构,这可以让您创建一个包含多个字段的新类型。

A single variable can only hold one thing at a time.  Perhaps you are looking for structures, which lets you create a new type that contains several fields.

    public struct学生{

       公共字符串名称;

        public int年龄;

       公共字符串学校

    }

    public struct Student {
        public string Name;
        public int Age;
        public string School
    }

   学生st;

    st.Name =" Tim Roberts";

    st.Age = 93;

    st.School =" Oregon Start";

    Student st;
    st.Name = "Tim Roberts";
    st.Age = 93;
    st.School = "Oregon Start";


这篇关于我是初学者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆