重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁!
查看《购买须知》>>>
找答案首页 > 全部分类 > 求职面试
搜题
网友您好, 请在下方输入框内输入要搜索的题目:
搜题
题目内容 (请给出正确答案)
[主观题]

程序填空题,请在横向上添上合适的语句,使程序能够完成指定的功能

暂无答案
更多“程序填空题,请在横向上添上合适的语句,使程序能够完成指定的功能”相关的问题

第1题

程序填空题: (请阅读下面拓扑排序算法程序,完成填空,...

程序填空题: (请阅读下面拓扑排序算法程序,完成填空,将答案写在该题横线上 ,每空3分,本题满分9分)。 int TopoSort (AdjList G) { Stack S; int indegree[MAX_VERTEX_NUM]; int i, count, k; ArcNode *p; FindID(G,indegree); /*求各顶点入度*/ InitStack(&S); for(i=0;i<g.vexnum;i++) if( ) push(&s,i); count="0;" while(!stackempty(s)) { pop(&s,&i); printf("%c",g.vertex[i].data); count++; p="G.vertexes[i].firstarc;" while( k="p-">adjvex; indegree[k]--; if(indegree[k]==0) Push(&S, k); ; } } /*while*/ if (count < G.vexnum) return(Error); else return(Ok); }

点击查看答案

第2题

程序补丁题:请在横线上填写正确的语句。 1、下列程序的...

程序补丁题:请在横线上填写正确的语句。 1、下列程序的功能是把从键盘输入的整数取绝对值后输出。 #include <stdio.h> int main(void) { int x; printf("please input x:\n"); scanf("%d”, ); if(x<0) ; printf("%d\n", ); return 0; } 2、下列程序的功能是从输入的整数中,统计大于零的整数个数和小于零的整数个数。用输入0来结束输入,用i,j来放统计数,请填空完成程序。    void main() { n,i="0,j=0;" printf(“input a integer,0 for end\n”); scanf(“%d”,&n); while ( ) if(n>0) ; else j=j+1; } printf(“i=%4d,j=%4d\n”,i,j); } 3.从键盘上输入一个百分制成绩score,按下列原则输出其等级:score≥90,等级为A;80≤score<90,等级为b;70≤score<80,等级为c;60≤score<70,等级为d;score<60,等级为e。 #include> void main(){ int data; char grade; printf("Please enter the score:"); scanf("%d”, &data); switch( ) { case 10: case 9 : grade= ; break; case 8: grade=’B’; break; case 7: grade=’C’; break; case 6: grade=’D’; ; default: grade=’E’; } printf("the grade is %c”, ); }

点击查看答案

第3题

程序填空题:完善程序,实现文件的复制功能。要求:在数字...

程序填空题:完善程序,实现文件的复制功能。要求:在数字标示和注释符(//)的前面,填入合适代码;并且不要删除数字标示和注释符://(数字)。 import java.io.*; public class FileStream1{ public static void main(String args []) { try { File inFile = new File("file1.txt"); //指定源文件 /*以file2.txt文件作为构造方法的参数,在(1)所在的语句创建File类的对象*/ //(1)指定目标文件 /*以文件对象作为数据源,在(2)创建字节输入流对象fis*/ //(2); FileOutputStream fos = new FileOutputStream(outFile); int c; /*逐字节从源文件中输入;补充(3)所在语句“_____”处的代码,依次读取字节*/ while ((c = fis._____)!=-1) //(3) /*逐字节输出到fos流;补充(4)所在语句的代码,依次写字节*/ //(4); fis.close(); fos.close(); }catch (FileNotFoundException e) { System.out.println("FileStreamsTest: "+e); /*补充(5)所在语句“_____”处的代码*/ }catch(________ e){//(5) System.out.println("FileStreamsTest: "+e); } } } 提示: (1)文件类File的构造方法有多种重载形式,其构造的对象即可表示文件,也可表示文件夹;此外,构造方法只能与new运算符搭配使用。 (2)Java中所有输入数据流都拥有读数据的成员方法read(); (3)Java中所有输出数据流都拥有写读数据的成员方法write(); (4)Java中输入输出流的成员方法基本上都会抛出同一种异常。

点击查看答案

第4题

选择适当的语句填入空白处完成程序。 以下程序的功能是...

选择适当的语句填入空白处完成程序。 以下程序的功能是:从个位开始依次取整数 x 奇数位上的数字,组成一新 数 y, 如 x=7651234 时, y=7524。 将程序补充完整。 void odd(int x, int *y){ int r, t; _______16_______; r = 1; //位权 while (x){ t = _______17_______; *y = *y + t*r; r = _______18_______; x =_______19_______; } } int main(){ int x, y; scanf("%d", &x); _______20_______; printf("%d", y); return 0; } 16. A. t=0; B. t=1; C.*y=0; D. x=0; 17. A. t+1 B.x%10 C. x/r D. x/10 18. A. r+1 B.r%10 C. r*10 D. r/10 19. A. t+1 B.x++ C. x/10 D. x/100 20. A. odd(x, &y) B. odd(x, y) C. odd(x, *y) D. odd(&x, y) 请将这5题的答案填空,中间不用有空格或任何分隔符。

点击查看答案

第5题

程序填空题一: 下列程序的输出结果是。 A::Fun C::Do ...

程序填空题一: 下列程序的输出结果是。 A::Fun C::Do 请在答题框中给出程序中红色下划线处应填入的语句。 #include <iostream> using namespace std; class A { private: int nVal; public: void Fun() { cout << "A::Fun" << endl; } virtual void Do() { cout << "A::Do" << endl; } }; class B:public A { public: void Do() { cout << "B::Do" << endl; } }; class C:public B { public: void Do( ) { cout << "C::Do" <<endl; } void fun() { cout "c::fun" endl; }; call( ________ ) p.fun(); p.do(); int main() c c; call(c); return 0;>

点击查看答案

第6题

程序填空题: 某软件公司B,在进行程序编写时需要用到[...

程序填空题: 某软件公司B,在进行程序编写时需要用到的近似值,其中的近似值计算公式如下:前200项之积,现在需要程序员小赵编写一个函数实现求的这个近似的一个函数,请你帮助小赵将此函数补充完整。 程序如下:程序的运行结果如下所示:答题要求:可以手写拍照上传图片或者直接填写。

点击查看答案

第7题

【填空题】观看视频,在横线上填上合适的单词。 A Tang Su...

【填空题】观看视频,在横线上填上合适的单词。 A Tang Suit (tangzhuang) is not a suit of the Tang Dynasty (618-907) but a suit with Chinese style. Tangzhuang are tailored according to specific 1 . Brocade is the first choice when selecting 2 for tangzhuang. Stand-up collars and 3 lapels are typical styles. Exquisite 4 is another feature of tangzhuang. Even the little buttons are made with great detail. These unique buttons are the finishing touches of tangzhuang. Nowadays people put on tangzhuang for the Spring Festival or weddings. People regard tangzhuang as special clothing for important 5 . Absorbing some elements from Western designs, tangzhuang now has a more fashionable, beautiful look.

点击查看答案

第8题

程序填空: 本题功能是创建一个线程,按照从1到5递增的...

程序填空: 本题功能是创建一个线程,按照从1到5递增的顺序将这两个整数打印出来,使程序的输出结果如下: x=1,y=1 x=2,y=2 x=3,y=3 x=4,y=4 x=5,y=5 //*********Found********** public class Java_1 ___________________{ private int x=0; private int y=0; public static void main(String[] args){ Java_1 r = new Java_1(); //*********Found********** Thread t = new Thread( ___________________ ); t.start(); } public void run() { //*********Found********** int ___________________ = 0; for(;;){ x++; //*********Found********** ___________________; k++; if (k>5) ________________; //退出for循环 System.out.println("x=" + x + ",y ="+ y); } } }

点击查看答案

第9题

【填空题】读下面程序,写出程序运行结果。 class Point{ ...

【填空题】读下面程序,写出程序运行结果。 class Point{ int x; public Point(){x=0;} public Point(int x){this.x=x;} public void show(){System.out.println(x);}} class SPoint extends Point{ int y; public SPoint(){y=0;} public SPoint(int x,int y){super(x); this.y=y;} public void show(){System.out.println(x+","+y);}} public class tempDemo{ public static void main(String []args){ Point p=new Point(); p.show(); Point p1=new Point(2); p1.show(); SPoint sp=new SPoint(); sp.show(); SPoint sp1=new SPoint(2,3); sp1.show(); }} 运行结果为:

点击查看答案

第10题

【填空题】读下面程序,写出程序运行结果。 abstract clas...

【填空题】读下面程序,写出程序运行结果。 abstract class Graph{ int a; public Graph(){a=1;} public Graph(int a){this.a=a; } public abstract void showArea(); } class Rect extends Graph{ int b; public Rect(int a,int b){super(a); this.b= b; } public void showArea(){ System.out.println("Area:"+(a*b));} } class Circle extends Graph{ public Circle(){}; public Circle(int a){super(a);} public void showArea(){ System.out.println("Area:"+(3.14*a*a)); } } public class classDemo1{ public static void main(String []args){ Graph g1; g1=new Rect(2,3); g1.showArea(); g1=new Circle(2); g1.showArea(); g1= new Circle(); g1.showArea(); } } 运行结果为:

点击查看答案
下载上学吧APP
客服
TOP
重置密码
账号:
旧密码:
新密码:
确认密码:
确认修改
购买搜题卡查看答案
购买前请仔细阅读《购买须知》
请选择支付方式
微信支付
支付宝支付
选择优惠券
优惠券
请选择
点击支付即表示你同意并接受《服务协议》《购买须知》
立即支付
搜题卡使用说明

1. 搜题次数扣减规则:

功能 扣减规则
基础费
(查看答案)
加收费
(AI功能)
文字搜题、查看答案 1/每题 0/每次
语音搜题、查看答案 1/每题 2/每次
单题拍照识别、查看答案 1/每题 2/每次
整页拍照识别、查看答案 1/每题 5/每次

备注:网站、APP、小程序均支持文字搜题、查看答案;语音搜题、单题拍照识别、整页拍照识别仅APP、小程序支持。

2. 使用语音搜索、拍照搜索等AI功能需安装APP(或打开微信小程序)。

3. 搜题卡过期将作废,不支持退款,请在有效期内使用完毕。

请使用微信扫码支付(元)
订单号:
遇到问题请联系在线客服
请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系在线客服
恭喜您,购买搜题卡成功 系统为您生成的账号密码如下:
重要提示: 请勿将账号共享给其他人使用,违者账号将被封禁。
发送账号到微信 保存账号查看答案
怕账号密码记不住?建议关注微信公众号绑定微信,开通微信扫码登录功能
警告:系统检测到您的账号存在安全风险

为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!

- 微信扫码关注上学吧 -
警告:系统检测到您的账号存在安全风险
抱歉,您的账号因涉嫌违反上学吧购买须知被冻结。您可在“上学吧”微信公众号中的“官网服务”-“账号解封申请”申请解封,或联系客服
- 微信扫码关注上学吧 -
请用微信扫码测试
选择优惠券
确认选择
谢谢您的反馈

您认为本题答案有误,我们将认真、仔细核查,如果您知道正确答案,欢迎您来纠错

上学吧找答案