我需要在visual basic中編寫一個簡單的計數器。我正在做一個「多少舔到一個tootsie流行音樂中心的中心」。一個對話框將打開,詢問他們是否已經到達中心。如果回答否,它將循環並再次詢問。Visual Basic計數器循環在Excel中
如果回答是,它會結束程序並計算有多少個循環。誰能幫我這個?
謝謝你這麼多
我有java代碼是否有幫助:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Counter
{
public static void main(String[] args) throws IOException
{
int counter = 0;
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Are you are the center? ");
String answer = input.readLine();
while(answer.equals("no")) {
System.out.print("Are you are the center? ");
counter++;
answer = input.readLine();
}
System.out.println("It took " + ++counter + " licks.");
}
}
我有java代碼是否有幫助 進口java.io.BufferedReader中; import java.io.IOException; import java.io.InputStreamReader; public class Counter public static void main(String [] args)throws IOException {0} {0} {0} {0} int counter = 0; BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); System.out.print(「你是中心?」); String answer = input.readLine(); (answer.equals(「no」)){ System.out.print(「你是中心嗎?」); counter ++; answer = input.readLine(); } System.out.println(「花了」+ ++ counter +「licks。」); } } –
您是否正在嘗試在Visual Basic中編寫與該Java代碼具有相同功能的程序?到目前爲止,你有什麼?這是功課嗎? –