首页 > 大学专科> 电子信息
题目内容 (请给出正确答案)
[主观题]

设有如下程序 #include<stdio.h> main(argc,argv) int argc;char*argv[]; {FILE*fp; void fc(); int

设有如下程序

#include<stdio.h>

main(argc,argv)

int argc;char*argv[];

{FILE*fp;

void fc();

int i=1;

while(--argc>0)

if((fp=fopen(argv[i++],"r"))==NULL)

{ printf("Cannot open file!\n");

exit(1);

}

else

{fc(fp);fclose(fp);}

}

void fc(ifp)

FILE*ifp;

{ charc;

while((c=getc(ifp))!='#')putchar(c-32);

}

上述程序经编译、连接后生成可执行文件名为cpy.exe。假定磁盘上有三个文本文件,其文件名和内容分别为:

文件名 内容

a aaaa#

b bbbb#

c cccc#

如果在DOS下键入

cpy a b c<CR>

则程序输出______。

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“设有如下程序 #include<stdio.h> main(…”相关的问题
第1题
设有如下程序#include<stdio.h>main(){int **k, *j,i=100;j=&i; k=&j;printf("%d\n"”,**

设有如下程序 #include<stdio.h> main() { int **k, *j,i=100; j=&i; k=&j; printf("%d\n"”,**k); } 上述程序的输出结果是______。

A.运行错误

B.100

C.i的地址

D.j的地址

点击查看答案
第2题
设有以下程序 include<stdio.h> main() { int n1,n2; scanf("%d",&n2);

设有以下程序 include<stdio.h> main() { int n1,n2; scanf("%d",&n2); while(n2!=0) {n1=n2%10; n2=n2/10; printf("%d",n1); } } 程序运行后,从键盘上输入1186,则输出结果为______。

点击查看答案
第3题
设有下列程序: include<stdio.h> include<string.h> main() { int i; ch

设有下列程序: include<stdio.h> include<string.h> main() { int i; char s[10],t[10]; gets(t); for(i=0;i<2;i++) {gets(s); if(strcmp(t,s)<0) strcpy(t,s); } printf("%s\n",t); } 程序运行后,从键盘上输入(<CR>代表回车符):CDEF<CR>BADEF<CR>QTHRG<CR>,则程序的输出结果是______。

点击查看答案
第4题
现有如下程序: }}include“stdio.h” void fun(int x) { printf(“x=%d\n”,++x); } void main

现有如下程序: }}include“stdio.h” void fun(int x) { printf(“x=%d\n”,++x); } void main() { fun(12+5); ) 则程序的输出结果是()。

A.12

B.13

C.17

D.1 8

点击查看答案
第5题
如下程序的输出结果是什么#include<stdio.h>int main(void){int aaa=0;aaa=011;printf("%d",aaa);return 0;}()

A.011

B.11

C.9

D.%d

点击查看答案
第6题
有如下程序:#include<stdio.h>main(){int a=2,b= -1,c=2; if(a<b) if(b<0)c=0; elsec++; printf(

有如下程序: #include <stdio.h> main() { int a=2,b= -1,c=2; if(a<b) if(b<0) c=0; else c++; printf("%d\n",c); } 该程序的输出结果是

A.0

B.1

C.2

D.3

点击查看答案
第7题
有如下程序: #include<iostream> using namespace std; int main(){ int sum;

有如下程序: #include<iostream> using namespace std; int main(){ int sum; for(int i=0;i<6;i+=3){ sum=i; for(int j=i;j<6;j++)sum+=j; } cout<<sum<<end1; return 0; } 运行时的输出结果是()。

A.3

B.10

C.12

D.15

点击查看答案
第8题
若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"

若有如下程序: include "stdio.h" main() { char s[30]; Strcpy(&S[0],"adc"); Strcpy(&S[1],"def"); strcpy(&S[2],"gh");; printf("%S\n",s); 则程序运行后的输出结果是【 】。

点击查看答案
第9题
若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); st

若有如下程序: include"stdio.h" main() {char s[30]; strcpy(&s[0],"abc"); strcpy(&s[1],"de"); strcpy(&s[2],"f"); printf("%s\n",s); } 则程序运行后的输出结果是【 】。

点击查看答案
第10题
有两个C程序文件T18.c和myfun.c同在VC系统目录(文件夹)下,其中T18.c文件如下: include <st

有两个C程序文件T18.c和myfun.c同在VC系统目录(文件夹)下,其中T18.c文件如下: include <stdio.h> include "myfun.c" main() { fun(); prinff("\n"); } myfun.c文件如下: void fun() { char s[80],c;int n=0; while((c=getchar())! :\n) s[n++] =c; n--; while (n>=0) prinff("%c" , s [n--] ); } 当编译连接通过后,运行程序T18时,输入"Thank!”,则输出结果是【 】。

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改