题目详情

【函数2.1说明】

  函数 int fun1(int m,int n)的功能是:计算并返回正整数m和n的最大公约数。

【函数2.2说明】

  函数long fun2 ( char *str )的功能是:自左至右顺序取出非空字符串 str 中的数字字符形成一个十进制整数(最多8位)。例如:若字符串 str的值为“f3g8d5. ji2e3p12fkp”,则函数返回值为3852312。

【函数2.1】

  int fun1(int m,int n)

 {

   while ( __(1)__ ) {

   if (m>n) m=m-n;

   else n=n-m;

  }

  ___(2)___ ;

 }

【函数2.2】

  long fun2 ( char *str )

 {

  int i=0;

  long k=0;

  char *p=str;

  while ( *p !=’\0’ && ___(3)___ ) {

  if ( *p >= ’0’ && *p <= ‘9’ ) {

    k = __(4)__ + *p – ‘0’ ;

    ++i;

   }

   ___(5)___ ;

  }

  return k;

 }

正确答案及解析

正确答案
解析

函数2.1:

(1) m ! =n ;

(2) return m; 或return n;

函数2.2:

(3) i<8;

(4) k*10;

(5) p++

你可能感兴趣的试题

单选题

The Internet of( 1)(IoT) describes physical objects that are embedded with Sensor,processing abilities,softwares,and other technologies that connect with other devices and systems over the ( 2) or other communication and exchange data networks .Over the past few years, IoT has become one of the most important technologies of the ( 3 ) centuryWe can connect objects to the Internet via embedded devices. By means of( 4) computing, the cloud, big data, and mobile technologies, physical things can share and collect data with minimal human intervention. Traditional fields of embedded systems,wireless ( 5) networks (WSNs),control systems,automation, independently and collectively enable IoT.回答5处

  • A.sensor
  • B.searching
  • C.service
  • D.source
查看答案
单选题

The Internet of( 1)(IoT) describes physical objects that are embedded with Sensor,processing abilities,softwares,and other technologies that connect with other devices and systems over the ( 2) or other communication and exchange data networks .Over the past few years, IoT has become one of the most important technologies of the ( 3 ) centuryWe can connect objects to the Internet via embedded devices. By means of( 4) computing, the cloud, big data, and mobile technologies, physical things can share and collect data with minimal human intervention. Traditional fields of embedded systems,wireless ( 5) networks (WSNs),control systems,automation, independently and collectively enable IoT.回答4处

  • A.low-level
  • B.low-cost
  • C.high-cost
  • D.high-performance
查看答案
单选题

The Internet of( 1)(IoT) describes physical objects that are embedded with Sensor,processing abilities,softwares,and other technologies that connect with other devices and systems over the ( 2) or other communication and exchange data networks .Over the past few years, IoT has become one of the most important technologies of the ( 3 ) centuryWe can connect objects to the Internet via embedded devices. By means of( 4) computing, the cloud, big data, and mobile technologies, physical things can share and collect data with minimal human intervention. Traditional fields of embedded systems,wireless ( 5) networks (WSNs),control systems,automation, independently and collectively enable IoT.回答3处

  • A.19th
  • B.20th
  • C.21th
  • D.22th
查看答案
单选题

The Internet of( 1)(IoT) describes physical objects that are embedded with Sensor,processing abilities,softwares,and other technologies that connect with other devices and systems over the ( 2) or other communication and exchange data networks .Over the past few years, IoT has become one of the most important technologies of the ( 3 ) centuryWe can connect objects to the Internet via embedded devices. By means of( 4) computing, the cloud, big data, and mobile technologies, physical things can share and collect data with minimal human intervention. Traditional fields of embedded systems,wireless ( 5) networks (WSNs),control systems,automation, independently and collectively enable IoT.回答2处

  • A.path
  • B.Internet
  • C.route
  • D.switch
查看答案
单选题

The Internet of( 1)(IoT) describes physical objects that are embedded with Sensor,processing abilities,softwares,and other technologies that connect with other devices and systems over the ( 2) or other communication and exchange data networks .Over the past few years, IoT has become one of the most important technologies of the ( 3 ) centuryWe can connect objects to the Internet via embedded devices. By means of( 4) computing, the cloud, big data, and mobile technologies, physical things can share and collect data with minimal human intervention. Traditional fields of embedded systems,wireless ( 5) networks (WSNs),control systems,automation, independently and collectively enable IoT.回答1处

  • A.this
  • B.thing
  • C.think
  • D.things
查看答案

相关题库更多 +