![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
有以下程序: #include<stdio.h> iht fun(iht n,int*p) { int f1,f2; if(n==1||,n==2)*p=1; else { fun(n-1,&f1);fun(n-2,&f2); *p=f1+f2; } } main() { int s; fun(3,&s); printf("%d\n",s); } 程序的运行结果是______。
A.2
B.3
C.4
D.5
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)
A.2
B.3
C.4
D.5
A.741
B.963
C.852
D.875421
A.min = 12
B.min = -34
C.-56
D.min = -56
A.beijing
B.china
C.welcome
D.tiananmen
以下程序中,错误的行是
①#include
②class A
③{
④ public:
⑤ int n=2:
⑥ A(int val){cout<<
⑦ ~A(){};
⑧};
⑨void main()
⑩{
⑩ A a(0);
⑩}
A.⑤
B.⑥
C.⑦
D.⑩
A.#includeIRremote.h
B.#includeIRremote
C.#include
D.#include‘IRremote.h’
给定以下程序段insert code public class foo {public static void main (String[] args) throws Exception {printWriter ut = new PrintWriter (new java.io.outputStreamWriter (System.out), true) ;out.printIn(“Hello”);}要使程序能正确运行,在insert code处必须添加()语句。
A、include java.io.OutputStreamWriter;
B、import java.io.OutputStreamWriter;
C、import java.io.PrintWriter;
D、include java.io.PrintWriter
A.10
B.1
C.死循环,不能确定次数
D.6
A.预处理命令行必须位于C源程序的起始位置
B.在C语言中,预处理命令行都以#开头
C.每个C程序必须在开头包括预处理命令行:#include
D.C语言的预处理不能实现宏定义和条件编译的功能
阅读以下程序及对程序功能的描述,其中正确的是
#include <stdio.h>
main()
{ FILE *in,*out;
char ch,infile[10],outfile[10];
printf("Enter the infile name:\n");
scanf("%s",infile);
printf("Enter the outfile name: \n");
scanf("%s",outfile);
if((in=fopen(infile,"r"))==NULL)
{ printf("cannot open infile\n");
exit(0); }
if((out=fopen(outfile,"w"))==NULL)
{ printf("cannot open outfile\n");
exit(0); }
while(! feof(in))fputc(fgetc(in),out);
fclose(in);fclose(out); }
A.程序完成将磁盘文件的信息在屏幕上显示的功能
B.程序完成将两个磁盘文件合二为一的功能
C.程序完成将一个磁盘文件复制到另一个磁盘文件中
D.程序完成将两个磁盘文件合并并在屏幕上输出