亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

“CS1513:}預期”錯誤

“CS1513:}預期”錯誤

C#
一只名叫tom的貓 2021-06-25 15:02:29
當我編譯以下代碼時,我不斷收到“CS1513:}預期”錯誤。錯誤發生在 user_input 方法的左括號處。我是 C# 新手,仍在學習。對不起,如果我遺漏了一些明顯的東西。我已經搜索了多個論壇,但沒有找到解決方案。在此先感謝您的幫助!using System;namespace App{class AppClass{    static void Main()    {    }    void user_input()    {        public int input1;        public int input2;        public string operation;        while (operation != "+" or operation != "-")        {            Console.WriteLine("Would you like to Add or Subtract?");            operation = Convert.ToString(Console.ReadLine());        }        Console.WriteLine("Please enter the first input:");        input1 = Convert.ToInt32(Console.ReadLine());        Console.WriteLine("Please enter the second input:");        input2 = Convert.ToInt32(Console.ReadLine());    }    void do_math()    {        public int output;        if (operation == "+")        {            output = input1+input2;        } else {            output = input1-input2;        }    }    void display()    {        Console.WriteLine("The answer is {0}", output);    }}}
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 480 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號