| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1410 人关注过本帖
标题:[快呀]近来看 行列式计算
只看楼主 加入收藏
chali
Rank: 1
等 级:新手上路
帖 子:20
专家分:0
注 册:2005-1-11
收藏
 问题点数:0 回复次数:4 
[快呀]近来看 行列式计算

   using System; class Range { static void Main() { int iCount=0; Console.WriteLine("小伙,目前你的方程组只能含有3个方程呀!"); int aFang=int.Parse(Console.ReadLine()); Console.WriteLine("那目前你的方程只能含有3项呀!"); int bFang=int.Parse(Console.ReadLine()); int[,] iRan=new int[aFang,bFang]; try { for (int i=0;i<aFang;i++) { iCount++; Console.WriteLine("请按要求输入你的第{0}个方程的内容!",iCount);

for (int j=0;j<bFang;j++) { Console.WriteLine("请输入相应项的系数!"); iRan[i,j]=int.Parse(Console.ReadLine()); } } for (int i=0;i<aFang;i++) { Console.WriteLine(); for (int j=0;j<bFang;j++) { Console.Write(iRan[i,j]+" "); } } } catch(Exception e) { Console.WriteLine("小伙,你输入的不是一个数吧!"); } int iRe=0; iRe=iRan[0,0]*iRan[1,1]*iRan[2,2]+iRan[0,1]*iRan[1,2]*iRan[2,0]+iRan[0,2]*iRan[1,0]*iRan[2,1]+iRan[0,2]*iRan[1,1]*iRan[2,0]+iRan[0,0]*iRan[1,2]*iRan[2,1]+iRan[0,1]*iRan[1,0]*iRan[2,2]; Console.WriteLine(); Console.WriteLine("行列式的结果是:{0}",iRe);

} } 同志们,你们看完了吧,   但是怎样能让它 用过catch 后就退出呢?    谢谢了!

搜索更多相关主题的帖子: 行列式 int Console 方程 
2005-04-02 20:43
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
收藏
得分:0 
finally()
{
  this.Close();
}

试试这样行不行,反正一定是用finally的了。
2005-04-03 01:46
yushengou
Rank: 1
等 级:新手上路
帖 子:401
专家分:0
注 册:2005-3-30
收藏
得分:0 
以下是引用live41在2005-4-3 1:46:40的发言: finally() { this.Close(); } 试试这样行不行,反正一定是用finally的了。
好像finally后面没有()的吧

我是初学者,希望大家能多多帮助我 /bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif');}" onmousewheel="return imgzoom(this);" alt="" />
2005-04-04 10:35
hanyou
Rank: 1
等 级:新手上路
威 望:1
帖 子:105
专家分:0
注 册:2005-4-2
收藏
得分:0 
你写的代码也太麻烦了吧。这么长呀!
2005-04-04 18:34
梦幻情缘
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:769
专家分:20
注 册:2005-4-4
收藏
得分:0 
不管怎么样做出来了,就不错了。
2005-04-04 18:38
快速回复:[快呀]近来看 行列式计算
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017979 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved