单项选择题

有以下程序 main() {char*P[]={"3697","2584"}; int i,j;long num=0; for(i-0;i<2;i++) {j=0; while(P[i][j]!=’\0’) { if((P[i][j]-’’0’’)%2)num=10*num+P[i][j]-’’0’’; j+=2; } } printf("%d\n",num); } 程序执行后的输出结果是【 】。

A.35
B.37
C.39
D.3975
<上一题 目录 下一题>
热门 试题

单项选择题
以下程序企图把从终端输入的字符输出到名为abc.txt的文件中,直到从终端读入字符#号时结束输入和输出操作,但程序有错。#include <stdio.h>main( ){ FILE *fout; char ch;fout=fopen(’’abc.txt’’,’’w’’);ch=fgetc(stdin);while(ch!=’’#’’){ fputc(ch,fout);ch =fgetc(stdin);}fclose(fout);}出错的原因是( )。
A. 函数fopen调用形式有误
B. 输入文件没有关闭
C. 函数fgetc调用形式有误
D. 文件指针stdin没有定义
单项选择题
有以下程序:#include<string.h>void f(char *s,char *t){char k;k=*s; +s=*t; *t=k;S++; t--;if(*s) f(s,t);}main(){char.str[10]= abcdefg ,*p;p=str+strlen(str) 2+1;f(p,p-2);printf( %s n ,str);}程序运行后的输出结果是【 】。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
相关试题
  • 数据独立性分为逻辑独立性与物理独立性。当...
  • 若有以下程序main( ){ int a=4,b...
  • 以下程序运行后的输出结果是【 】。main(...
  • 下列程序中函数fun的功能是:统计person所...
  • 下列程序的运行结果是:【 】#include ...