-5

ユーザーが答えられるように、数学の問題を開発するプログラムを取得しようとしています。プログラムを単独で実行すると、クリックするボタンが表示され、ボタンの数が増えました。誰でもこの問題を解決するのを手伝ってくれませんか。私が懸念しているプログラムの部分は、int Correctcount の始まりです。助けてください

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;


namespace Jagtutor
{

    [Activity(Label = "Addition")]
    public class AdditionsActivity : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            // Create your application here
            SetContentView(Resource.Layout.Second);

            var label = FindViewById<TextView>(Resource.Id.screen3Label);
            label.Text = Intent.GetStringExtra("ModuleData") ?? "Data not available";

            {
            int correctCount = 0;
            int count = 0;

                 while (count < 10);
                {
                    Random gen = new Random();
                    int num1 = gen.Next();
                    int num2 = gen.Next(); 


                    Console.Write("What is");
                    Console.Write(num1);
                    Console.Write( " - ");
                    Console.Write( num2);
                    Console.Write( "?");
                    int answer = Int32.Parse(Console.ReadLine());

                    if (num1 + num2 == answer) {
                        Console.Write(" Your are Correct!\n");
                        correctCount++;

                    }
                    else
                        Console.Write( "Your answer is wrong" );
                        Console.Write(num1);
                        Console.Write(" + ");
                        Console.Write(num2);
                        Console.Write("should be ");
                        Console.Write(num1 + num2);
                        count++;
                }
            }

        }
    }

 }
4

1 に答える 1

2

最後の本体の周りに { } がありませelseんか?

于 2012-04-27T21:13:07.077 に答える