快乐学习 一个网站喵查铺子(catpuzi.com)全搞定~

">打印所有的“水仙花数”。所谓“水仙花数”,是指一个三位数,其各位数字的立方和等于该数本身。例如,153是“水仙花数”,因为代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include  int main() {     int i, j, k, n;     printf("result is:");     for (n=100; ________; n++)     {         i = n / 100;            //分离出百位         j = ____________;       //分离出十位         k = ____________;       //分离出个位           if (_________________________)         {                 printf("%d\t ",n);  //输出结果         }     }     printf("\n");     return 0; }

打印所有的“水仙花数”。所谓“水仙花数”,是指一个三位数,其各位数字的立方和等于该数本身。例如,153是“水仙花数”,因为代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include  int main() {     int i, j, k, n;     printf("result is:");     for (n=10……继续阅读 »

以下程序运行时,从键盘输入:01,程序执行后的输出结果是#include  int main( ) {      char k;      int i;     for(i=1;i<3;i++)     {          scanf("%c",&k);         switch(k)         {              case '0': printf("another\n");             case '1': printf("number\n");         }    }    return 0; }

以下程序运行时,从键盘输入:01,程序执行后的输出结果是<code>#include 
int main( )
{ 
    char k; 
    int i;
    for(i=1;i<3;i++)
    { 
        scanf("%c",&k);
        switch(k)
        { 
            case '0': printf("another\n");
            case '1': printf("number\n");
        }
   }
   return 0;
}</code>
A、 another number number B、 number number C、 another number D、 another number another 喵查答案: another number number ……继续阅读 »

程序运行后的输出结果是#include  int main() {          int i;            for(i=0;i<3;i++)                         switch(i)                                         {                                  case 0: printf("%d",i);                               case 2: printf("%d",i);                               default: printf("%d",i);                             }               return 0;    }

程序运行后的输出结果是<code>#include 
int main()
{ 
        int i;
  
        for(i=0;i<3;i++)   
        
            switch(i)    
                   
                {       
     
                    case 0: printf("%d",i);
         
                    case 2: printf("%d",i);
         
                    default: printf("%d",i);       
    
                } 
    
        return 0; 
 
}</code>
A、000122 B、022111 C、021021 D、012 喵查答案:000122 ……继续阅读 »

">爱因斯坦数学题。爱因斯坦曾出过这样一道数学题:有一条长阶梯,若每步跨2阶,最后剩下1阶;若每步跨3阶,最后剩下2阶;若每步跨5阶,最后剩下4阶;若每步跨6阶,最后剩下5阶;只有每步跨7阶,最后才正好1阶不剩。请问,这条阶梯共有多少阶?代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include  int main() {     int  x = 1, find = 0;     while (__________)     {         if (______________________)         {                 printf("x = %d\n", x);                 find = 1;            }         x++;     }          return 0; }

A、 第5行:     !find 第7行:     x%2==1 && x%3==2 && x%5==4 && x%6==5 && x%7==0 B、 第5行:      find==1 第7行:      x%2==1 && x%3==2 && x%5==4 ……继续阅读 »

">鸡兔同笼,共有98个头,386只脚,编程求鸡、兔各多少只。代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include  int main() {     int x, y;     for (x=1; _______; x++)     {         ____________;         if (____________)         {                 printf("x = %d, y = %d", x, y);         }     }          return 0; }

A、 第5行:     x<=97 第7行:     y = 98 – x 第8行:     2*x+4*y == 386 B、 第5行:     x<97 第7行:     x = 98 – y 第8行:     2*x+4*y == 386 C、 第5行:     x<97 第7行:     y = 98 ……继续阅读 »

以下正确的描述是

以下<strong>正确</strong>的描述是
A、只能在循环体内和switch语句体内使用break语句 B、 continue语句的作用是结束整个循环的执行 C、在循环体内使用break语句或continue语句的作用相同   D、continue语句可以写在循环体之外 喵查答案:只能在循环体内和switch语句体内使用break语句 ……继续阅读 »

以下不是死循环的程序段是

以下<strong>不是</strong>死循环的程序段是
A、int s=36; while (s)  {    --s; } B、int i=100; while(1) {     i=i%100+1;     if (i>100) break; } C、for( ; ;); D、unsigned int k=0; do{         ++k; } while (k>=0); 喵查答案:int s……继续阅读 »

">计算直到最后一项的绝对值小于为止。代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include   #include   int main() {     int n = 1;     float term = 1, sum = 0;     ______________;          while (fabs(term) >= 1e-4)      //判末项大小     {         term = sign / n;            //求出累加项         sum = sum + term;           //累加         ________________;               //改变项的符号                 n++;                            //分母加1     }     printf("sum = %f\n", sum);     return 0; }

计算直到最后一项的绝对值小于为止。代码如下,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。#include   #include   int main() {     int n = 1;     float term = 1, sum = 0;     ______________;          while (fabs(term) ……继续阅读 »