皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【单选题】
围绕山顶一圈有N个山洞,编号为0、1、2、3、......、N-1,有一只狐狸和一只兔子在洞中居住。狐狸总想找到兔子并吃掉它,它的寻找方法是先到第一个洞(即编号为0的洞)中找;再隔1个洞,即到编号为2的个洞中找;再隔2个洞,即到编号为5的洞中找;下次再隔3个洞;即到编号为9的洞中找;......。若狐狸找一圈,请为兔子指出所有不安全的洞号。用a数组元素模拟一个洞,数组元素的下标即为洞号,数组元素中的值为0时,表示该洞安全,为1时表示该洞不安全。若形参n的值为30时,不安全的洞号是0、2、5、9、14、20、27。 #include #define N 100 void fun( int *a , int n ) { int i, t; for( i=0; i a[i]=0; i=0; t=1; while( i { a[i]= 1; t++; /**********found**********/ i=___3___; } } main() { int a[N], i, n=30; fun( a, n); for(i=0; i if( a[i]==1 ) printf("不安全的洞号是 : %d\n",i ); }
A.
i
B.
t
C.
t++
D.
i+t
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【简答题】Answer these questions in brief answers. 1 When and where was the first Volvo car manufactured? 2 What kind of vehicles did Volvo manufacture? 3 What was the idea behind the first Volvo car? 4 Why wer...
【简答题】Part Two: 1. What did art historians view Renaissance as? 2. What did literary scholars in the Anglo-American world focus on when they talked about Renaissance? 3. What did historians label this perio...
【判断题】校园宣讲会并不重要,所以可以随便提问。()
A.
正确
B.
错误
【单选题】用分析天平准确称取0.2g试样,正确的记录应是
A.
0.2g
B.
0.20g
C.
0.200g
D.
0.200g
【单选题】用分析天平准确称取0.2g试样,正确的记录应是
A.
0.2g
B.
0.20g
C.
0.200g
D.
0.2000g
【单选题】用分析天平准确称取0.2g试样,正确的记录为
A.
0.2g
B.
0.20g
C.
0.200g
D.
0.2000g
【简答题】Part time (口语) 1) Why did you have a part time job? What’s the purpose? 2) What is your job and what is your responsibility? 3) What did you think of when you were seeking a part-time job? 4) For your...
【简答题】Listen to Part I and answer the questions. 1.What values did parents teach their children in the 1950s? 2. How did young people rebel against their parents? 3. What were the main topics of Bob Dylan’s...
【简答题】Listen to recordings about cultural affairs in the US during the 1960s and finish the tasks. Listen to Part I and answer the questions. 1. What values did parents teach their children in the 1950s? 2....
【单选题】中国古代曾经“铸九鼎,象九州”的历史人物是( )
A.
子产
B.
夏桀
C.
叔向
D.
夏禹
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题