static void Main(string[] args)? ? ? ? {? ? ? ? ? ? string[] name = { "吳松", "錢東宇", "伏晨", "陳路", "周陸", "林日鵬", "何昆", "關(guān)欣" };? ? ? ? ? ? int[] score = { 29, 90, 98, 56, 60, 91, 93, 85 };? ? ? ? ? ? int max =0;? ? ? ? ? ? int x;//如果這里改為int x=0;就沒有問題,是為什么。。? ? ? ? ? ? for (int i = 0; i < score.Length; i++)? ? ? ? ? ? {? ? ? ? ? ? ? ? if (score[i]>max)? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? max=score[i];? ? ? ? ? ? ? ? ? ? x = i;//這里不是對x進(jìn)行賦值了嗎?? ? ? ? ? ? ? ? }? ? ? ? ? ? }? ? ? ? ??? ? ? ? ? ? Console.WriteLine(max);????????????????? ? ? Console.WriteLine(x); //這里提示x未賦值? ? ? ? }
關(guān)于賦值的問題
鄭小賤丶4420041
2016-11-22 20:38:05