Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:题目里明确说了2~15个数 为什么我数组开到了15 会越界??In Reply To:题目里明确说了2~15个数 为什么我数组开到了15 会越界?? Posted by:Snow_storm at 2009-11-22 13:50:34 > 无语掉。。。。。还是我英语水平太烂的缘故?? 我的水程序 #include<iostream> using namespace std; int main() { double s[100]; do { int i=0,z=0; cin>>s[0]; if(s[0]!=-1) { while(s[i]!=0) { i++; cin>>s[i]; } int a,b; for(a=0;a<i;a++) for(b=0;b<i;b++) if(s[b]/s[a]==2) z++; cout<<z<<endl; } }while(s[0]!=-1); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator