qsr10250030  
saturn
日历
<2006年10月>
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234
统计
  • 随笔 - 15
  • 文章 - 0
  • 评论 - 6
  • 引用 - 0

导航

常用链接

留言簿(2)

随笔档案(15)

金属网

我的编程

搜索

  •  

最新评论

阅读排行榜

评论排行榜

 
题目:要求输入一个数组找出第一个负数,并输出其位子.
#include<iostream>
using namespace std;
int main(){
int a[2][3],i,j,t=0 ;
cout<<"input a[2][3]:\n";
for(i=0;i<2;i++)
{for(j=0;j<3;j++)
cin>>a[i][j];}
for(i=0;i<2;i++)
for(j=0;j<3;j++)
if (a[i][j]<0) {cout<<"a["<<i<<"]["<<j<<"]"<<a[i][j];t=1;break;}
if(!t)cout<< "On found!\n";
return 0;
}
有什么更好的思路请告诉我啊!
posted on 2006-10-02 13:53 快乐蝴蝶飞 阅读(187) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


 
Copyright © 快乐蝴蝶飞 Powered by: 博客园 模板提供:沪江博客