niusouti.com

I'm () a list of things to buy.A、makingB、doingC、looking

题目
I'm () a list of things to buy.

A、making

B、doing

C、looking


相似考题

2.针对以下C语言程序,请按要求回答问题。已知link. c源程序如下:/*link. c程序对单向链表进行操作,首先建立一个单向链表,然后根据用户的选择可以对其进行插入结点、删除结点和链表反转操作*/include<stdio. h>include<stdlib. h>typedef struct list_node * list_pointer; //定义链表指针typedef struct list_node{ //定义链表结构int data;list_pointer link;}list_node;//用到的操作函数list_pointer create(); //建立一个单向链表void insert(list_pointer * p_ptr,list_pointer node); //在node后加入一个新的结点void delete_node(list_pointer * p_ptr,list_pointer trail,list_pointer node);//删除前一个结点是trail的当前结点nodevoid print(list_pointer * p_ptr); //打印链表结点中的值list_pointer invert(list_pointer lead); //反转链表int main(){list_pointer ptr=NULL;list_pointer node,trail;list_pointer * P=&ptr;int choose,location,i;printf("you should create a link first:\n");//建立一个单向链表prt=create(); //ptr指向链表的第一个结点print(ptr);//根据用户的不同选择进行相应的操作:printf("input number 0,you can quit the program\n");printf("input number 1,you can insert a new node to link\n"):printf("input number 2,you can delete a node from the link\n");printf("input number 3,you can invert the link\n"):printf("please input you choice\n");scanf("%d",&choose);while(choose!=0){switch(choose){case 1:i=1:while(i<location){node=node->link;i++:}insert(p,node); //p为指向ptr的指针print(ptr);break;case 2:printf("you will delete a node from the link\n");printf("please input the location of the node:\n");scanf("%d",&location):node=ptr;if(location==1)trail=NULL;trail=ptr;i=1:while(i<location){trail=trail->link:i++:}node=trail->link;delete_node(p,trail,node);print(ptr);break;case 3:printf("you will invert the link\n");ptr=invert(ptr);print(ptr);break;default;break;return -1;}printf("please input you choice\n");scanf("%d". &choose):}return 0;//根据用户的输入值建立一个新的单向链表:list_pointer create(){int i,current,length;list_pointer p1,p2,head;printf("please input the node number of the link:\n");scanf("%d". &length):printf("the number of the link is:%d",length);printf("please input the data for the link node:\n");i=0;p1=p2=(list_pointer)malloc(sizeof(list_node));head=p1;for(i=1;i<length;i++){scanf("%d",&current);p1->data=current;p2->link=p1;p2=p1;p1=(list_pointer)malloc(sizeof(list_node));}p2->link=NULL;return head;}画出主函数main的控制流程图。

参考答案和解析
参考答案:A
更多“I'm () a list of things to buy. ”相关问题
  • 第1题:

    在窗体上有一名为list1的列表框和名为Command1的命令按钮,要求程序运行后;如果单击命令按钮,则把列表框中所有的列表项目写到顺序文件list.txt 中。下列能完成该操作的程序是______。

    A. Private Sub Command1_Click() Open “c:\list.txt”For Input As #1 For i=0 To Listl.ListCount-1 Print #1,List1.List(i) Next i Close #1 End Sub

    B.Private Sub Command1_lick() Open “c:\list.txt”For Output As #1 For i=0 To List1.ListCount Print #1,List1.List(i) Next i Close #1 End Sub

    C.Private Sub Command1_Click() Open “c:\list.txt”For Output As #1 For i=0 To List1.ListCount -1 Print #1,List1. List(i) Next i C1ese #1 End Sub

    D.Private Sub Command1_Click() Open “c:\list.txt”For As #1 For i=0 To List1.ListCount Print #1,List1.List(i) Next i Close #1 End Sub


    正确答案:C

  • 第2题:

    下面哪一个是错误的?

    A.使用len(列表名)测量元素的个数names_list=["zhangsan","lisi","wangwu"]print(len(names_list))

    B.使用列表名[下标]获取列表的某个元素,例如:names_list=["zhangsan","lisi","wangwu"]print(names_list[2])

    C.向列表中添加新元素有三个方法:append、extend、insert,例如:names_list=["zhangsan","lisi","wangwu"]names_list.append("zhaoliu")names_list.extend(["zhaoliu","liqi"])names_list.insert(1,"zhaoliu")print(names_list)

    D.已有列表nums=[11,22,33,44,55],使用while循环遍历列表nums=[11,22,33,44,55]i=0 whilei

    print(nums[i])i+=1


    正确答案:D

  • 第3题:

    写出以下代码的输出结果: public class Test{ public static void main(String[] args){ int list[] = {1,2,3,4,5,6}; for(int i = 1; i < list.length; i++) list[i] = list[i - 1]; for(int i = 0; i < list.length; i++) System.out.print(list[i] + " "); } }


    代码编译失败,因为类A不是抽象类,所以其中的method( )方法不能是抽象方法。;代码编译失败,如果将A声明为抽象的(abstract),可使代码编译通过。

  • 第4题:

    在窗体上画一个名称为Command1的命令按钮和一个名称为List1的列表框。如下图所示程序的功能是:单击命令按钮后,程序用“筛选法”求出1-100之间的全部素数。并将素数在列表框中显示出来。根据题意,填空处应选择

    Option Base 1 Dim a(100)As Integer Private Sub Command1_Click() n = 100 For i = 2 To Sqr(n) For j = i + 1 To n If j Mod i = 0 And a(j)<> 0 Then a(j)= 0 Next j Next i For i = 1 To n If a(i)<> 0# Then Next i End Sub Private Sub Form_Load () For i = 1 To 100 a (i)=i Next i End Sub

    A.List1.Text=Str(a(i))+ vbCrLf

    B.List1.Text=Str(a(i))+ vbCrLf

    C.List1.AddItem a(i)

    D.List1.AddItem=a(i)


    正确答案:C
    解析:程序的功能是:先将其下标值作为数组的初值,然后,用2去除它后面的每个数,如能被整除,就将其值赋0,再用3、4.....去除它后面的每个数,也是如能被整除,就将其值赋0,数组剩下的非0值就是素数。最后将其素数在List1列表框中显示出来。注意此题中的数组a是公共变量。向列表框添加内容时,选项C是正确的。

  • 第5题:

    编写程序,删除列表list1中存在的重复元素, 请补充程序完整。 list1 = [3, 4, 4, 5, 5,9 ,6, 9,10,100,9,8,3] list2=[] for i in list1: if not i in list2: list2.______(i) print(list2)


    list1.pop();list1.remove(1)

  • 第6题:

    7、下列选项中,会输出1,2,3三个数字的是()

    A.for i in range(3) print(i)

    B.for i in range (2): print(i+1)

    C.a_list=[0,1,2] for i in a_list: print(i+1)

    D.i=1 while i<3: print (i) i=i+1


    for i in range(3): print(i+1)