皮皮学,免费搜题
登录
搜题
【简答题】
程序填空题【只能填一个运算符(标识符、常量)】 要求输出: 5.5 using System; namespace FillBlanks1 { public struct TupNode < T > { public int r; public int c; public T d; }; public struct TSMatrix < T > { public int rows; public int cols; public int nums; public TupNode [] data; }; public class SMatrixClass < T > { public TSMatrix trip; public SMatrixClass( int rows, int cols) { trip = new TSMatrix { data = new TupNode [100], rows = rows, cols = cols }; } public bool Setvalue( int i, int j, T x) { if (i < 0 || i >= trip.rows || j < 0 || j >= trip.cols) return false ; int k = 0; while (k < trip.nums && i > trip.data[k].r) k++; while (k < trip.nums && i == trip.data[k].r && j > trip.data[k].c) k++; if (trip.data[k].r == i && trip.data[k].c == j) trip.data[k].d = x; else { for ( int k1 = trip.nums - 1; k1 >= k; k1--) { trip.data[k1 + 1].r = trip.data[k1].r; trip.data[k1 + 1].c = trip.data[k1].c; trip.data[k1 + 1].d = trip.data[k1].d; } trip.data[k].r = i; trip.data[k].c = j; trip.data[k].d = x; trip.nums++; } return true ; } public bool GetValue( int i, int j, ref T x) { if (i < 0 || i >= trip.rows || j < 0 || j >= trip.cols) return false ; int k = 0; while (k < trip.nums && trip.data[k].r < i) k++; while (k < trip.nums && trip.data[k].r == i && trip.data[k].c < j) k++; if (trip.data[k].r == i && trip.data[k].c == j) x = trip.data[k].d; else x = default (T); return true ; } public SMatrixClass Transpose() { var tb = new SMatrixClass (trip.cols, trip.rows); tb.trip.rows = trip.cols; tb.trip.cols = trip.rows; tb.trip.nums = trip.nums; if (trip.nums != 0) { var q = 0; for ( int v = 0; v < trip.cols; v++) for ( int p = 0; p < trip.nums; p++) if (trip.data[p].c == v) { tb.trip.data[q].r = trip.data[p].c; tb.trip.data[q].c = trip.data[p].r; tb.trip.data[q].d = trip.data[p].d; q++; } } return tb; } } class Program { static void Main( string [] args) { var sMatrix = new SMatrixClass< double >(6, 6); sMatrix.Setvalue(1, 2, 5.5); sMatrix.Setvalue(3, 4, 6.7); var sMatrix2 = sMatrix.Transpose(); double x = 0; sMatrix2.GetValue( , ref x); Console.WriteLine(x.ToString()); } } }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】以下程序运行后的输出结果是( ) #include int main() { int a[10]={1,2,3,4,5,6,7,8,9,10},*p=&a[3],b; b=p[5]; printf("%d",b); return 0; }
A.
8
B.
5
C.
6
D.
9
【判断题】闪干阶段使用红外线烤灯烘烤,需要将红外线烤灯设定为脉冲烘烤模式。
A.
正确
B.
错误
【单选题】以下程序的输出结果是( )。 void reverse(int a[], int n) { int i,t; for(i=0;i
A.
22
B.
10
C.
34
D.
30
【判断题】因吸毒曾被强制戒毒的人员,不得开办娱乐场所或者在娱乐场所内从业
A.
正确
B.
错误
【判断题】判断:符号常量必须服从先定义后使用的原则,所以也可以把符号常量称为变量。( )
A.
正确
B.
错误
【简答题】1843年开埠以后,上海迅速崛起,在地利、移民人口、 三要素的综合作用下,成为中国最大城市和多功能经济中心。
【多选题】以下有关我国遥感技术发展,描述正确的有( )。
A.
1974 年,成功发射第一颗人造地球卫星东方红一号
B.
1975 年,成功发射第一颗返回式卫星
C.
1988 年,成功发射风云一号气象卫星
D.
2000 年,航天清华一号微型卫星 (HT-1) 发射成功
E.
2008 年,发射高分辨率商业成像卫星地球之眼
【多选题】完成反应 需要下列几步: 1 2 3 ,请找出正确的排序并回答问题
A.
①②③
B.
②①③
C.
①③②
D.
③②①
E.
③步对醛基起到了保护作用
【多选题】有下列情形的人员,不得开办娱乐场所或者在娱乐场所内从业( )。
A.
因故意杀人曾被剥夺政治权利的
B.
洗钱罪
C.
强奸罪
D.
因吸食毒品曾被强制戒毒的
【简答题】已知逻辑函数f(A,B)的真值表如下,试写出它的最小项表达式 A B F(A,B) 0 0 1 0 1 0 1 0 1 1 1 1
相关题目:
关于我们
免责声明
版本记录
© 2019 pipixue.com 京ICP备20000060号-6