首页 试题详情
单选题

仔细阅读下面程序,请给出运行结果( )。#include#includeint f1(int x){return x*x;}int f2(int x){return x*x*x;}main( ){int x=3,y1,y2,y3,y4;int(*f)( );f=f1;y1=(*f)(x);y2=f1(x);f=f2;y3=f(x);y4=f2(x);printf(“y1=%d,y2=%d,y3=%d,y4=%d\n”,y1,y2,y3,y4);}

Ay1=9,y2=9,y3=27,y4=27

By1=3,y2=9,y3=27,y4=9

Cy1=3,y2=3,y3=9,y4=9

Dy1=3,y2=9,y3=9,y4=27

正确答案:A (备注:此答案有误)

相似试题

  • 单选题

    仔细阅读下面程序给出运行结果。#include#includeint f1(int x{return x*x;}int f2(int x{return x*x*x;}main( {int x=3,y1,y2,y3,y4;int(*f;f=f1;y1=(*f(x;y2=f1(x;f=f2;y3=f(x;y4=f2(x;printf(“y1=%d,y2=%d,y3=%d,y4=%d n”,y1,y2,y3,y4;}

    答案解析

  • 单选题

    阅读下面程序:set_01 = {‘a‘, ‘c‘, ‘b‘, ‘a‘}set_01.add(‘d‘)print(len(set_01))运行程序,以下输出结果正确的是(

    答案解析

  • 单选题

    阅读下列程序程序运行结果是(

    答案解析

热门题库