最赞回答 / 棋圣丶龙骑士
你的代码是对的,输出结果中间的逗号,老师是英文的,你是中文的。另外,max并没有比较数组的最高分。这个代码是定义了一个int类型的变量max,来存储最高的分数,实际上,把max的定义和赋值删除掉,程序照样是对的。你只需要把最大的分数对应在数组的位置记录给k,然后输出两个数组中第k个元组就行了。参照下面代码:using System;using System.Collections.Generic;using System.Text;namespace projGetMaxScore{ class P...
2019-01-22
闰年定义是可以被4整除,不能被100整除,但是被400整除可以啊
int year = 2015;//年份
bool answer;
string text;
answer = (year % 4 == 0 && year % 100 != 0)|year%400==0;
text = answer == true ? ("闰年" ): text =( "平年");
Console.WriteLine("今年是{0}", text);
int year = 2015;//年份
bool answer;
string text;
answer = (year % 4 == 0 && year % 100 != 0)|year%400==0;
text = answer == true ? ("闰年" ): text =( "平年");
Console.WriteLine("今年是{0}", text);
2019-01-13
最赞回答 / 锺权
你这不是自作聪明嘛。。。这个算法的本意是在一堆数据里面筛选出最高分数和对应的学生,你直接靠肉眼观察选了个前三然后直接拿第二的分数选第一。。。那给你一千人的成绩你也打算靠肉眼观察再选个前三?本末倒置啊兄弟。。。
2018-12-29