一个main(inta,char*argv[])函数带参数,可执行文件名为prog.exe,若命令行输入:progabcdefg123则printf(“%d,%s\n”,a,argv[1]);的结果是()
A.3,prog
B.4,prog
C.3,abcd
D.4,abcd
A.3,prog
B.4,prog
C.3,abcd
D.4,abcd
第1题
B.public static void main(String args[])
C.public static int main(string [] ar
D.public void main(string arg[])
第2题
第3题
第4题
下面程序的功能是将一个字符串str的内容颠倒过来,请填空。 include<string.h> main() { inti,j,【 】;char str[]={"1234567"}; for(i=0,j=strlen(str)【 】;i<j;i++,j--) { k=str[i];str[i]=str[j];str[j]=k;} printf("%s\n",str);}
第5题
第6题
下面程序的功能是将一个字符串str的内容颠倒过来,请填空。 main() { int i,j,【 】;char str[]={"1234567"); for(i=0,j=strlen(str) 【 】;i<j;i++,j--) {k=str[i];str[i]=str[j];str[j]=k;} printf("%s\n",str); }
第7题
B.When compile, some error will occur.
C.Output is null.
D.Output is 0.
第8题
执行下面的程序段,输出结果为【 】。 public class Q { public Static Void main(String args[]) { int anar[]=new int[5]; System.out.println(anar[0]); } }
第9题
A.t.f
B.this.n
C.Test.m
D.Test.n
第10题
下面程序把从终端读入的文本(用作为文本结束标志)复制到一个名为file.txt的新文件中。补足所缺语句。 main() { char ch; FILE*fp; if((fp=fopen(______))=NULL)exit(0); while((ch=getchar())!=) fputc(ch,fp); ______; }
第11题
以下程序把从终端读入的文本(用@作为文本结束标志)输出到一个为out.dat的新文件中,请填空。
#include<stdio.h>
main()
{FILE*fp;char ch;
if((fp=______)==NULL) exit(0);
while((ch=getchar())!='@')
fputc(ch,fp);
fclose(fp);
}