---
title: "2-1 变量的赋值"
author: "kanglecjr"
date: "2009-07-06T10:17:17Z"
tags: ["C", "C#", "C++", "Linq"]
slug: "2-1"
draft: false
lastmod: "2009-07-06T10:17:17Z"
id: 420623
url: "https://kanglecjr.iteye.com/blog/420623"
---

```c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VarTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string str;
            double Sum = 0, a, b, c;
            a = 20;
            b = 30;
            c = 40;
            Sum = a + b + c;
            str = "a+b+c=";
            Console.Write(str);
            Console.WriteLine("{0}",Sum);
            Console.WriteLine("{0}+{1}+{2}={3}", a, b, c, Sum);
            Console.ReadKey();
        }
    }
}


```