#include main() { char ch[]=\abc\,x[3][4]; int i; for(i=0;i<3;i++) strcpy(x[i],ch); for(i=0;i<3;i++) printf(\%s\,&x[i][i]); printf(\\\n\); }
相似题目
-
以下程序的输出结果是( )。#include #include main(){ char *p=abcde\0fghjik\0
-
有下面的程序段,则( )。 #include void main() { char c[10]=China
-
下面程序的运行结果是( )#include#include#define N 30void change(char ch[]){int i=0;while(ch[i]){if(ch[i]>='a' && ch[i]<='u')ch[i] += 5;else if(ch[i]>='v' && ch[i]<='z')ch[i] -=21;i++;}}int main(){char ch[N]=ac8z
-
下列程序运行时,若输入 1abcedf2df< 回车 > 输出结果为 __________ 。 #include main() { char a=0,ch; while((ch=getchar())!='\n') { if(a%2!=0&&(ch>='a'&&ch<='z')) ch=ch-'a'+'A'; a++; putchar(ch); } printf(\n); }
-
有以下程序,程序的运行结果是 _________ 。 #include void main() { char ch='Z'; ch=(ch-'A'+1)%26+'A'; putchar(ch); }
-
有如下程序: #include int main() { char ch[2][5]={6937,8254}; int i,j,s=0; for(i=0;i<2;i++) for(j=0;ch[i][j]>'\0';j+=2) s=10*s+ch[i][j]-'0'; printf(%d\n,s); return 0; } 该程序的输出结果是 ( ) 。
-
用getchar()从键盘上输入一个字符,用putchar()打印出来!参考程序1与参考程序2都可以实现题目要求。#include int main(){char a;a=getchar();putchar(a);return 0;}参考程序2:#include int main(){char ch;scanf(“%c”,&ch);printf(“%c”,ch);return 0;}
-
已知字符a的ASCII码值为97,则以下程序的输出结果是__________。#include 'stdio.h'void main(){ char ch='c';printf('%c%d ',ch,ch);}
-
以下程序的输出结果是( )。#include char cchar(char ch){if(ch>='A' && ch<='Z')ch=ch-'A'+'a';return ch;}int main( ){char s[ ]=\ABC+abc=defDEF\,*p=s;while(*p){*p=cchar(*p);p++;}printf(\%s\\n\,s);return 0;}
-
有以下程序段#include “stdio.h”main(){ char ch1,ch2;int n1;n2;ch1=getchar(); ch2=getchar();n1=ch1-’0’;n2=n1*10+(ch2-‘0’);printf(“%d\\n”;n2)} 程序运行时输入:12,执行结果是 【1】 。
-
有以下程序 #include main() { FILE *pf; char *s1=\China\,*s2=\Beijing
-
有以下程序#includevoid main( ){ char ch = '1';while (ch < '9'){printf('%d', ch - '0');ch++;}}程序运行后的输出结果是_______。
-
以下程序企图把从终端输入的字符输出到名为abc.txt的文件中,直到从终端读入字符号时结束输入和输出操作,但程序有错。include main(){ FILE *fout; char ch;fout=fopen('abc.txt','w');ch=fgetc(stdin);while(ch!=''){ fputc(ch,fout);ch =fgetc(stdin);}fclose(fout);} 出错的原因是
-
设有如下程序 include main() { char ch1='A',ch2='a'; printf("%c\n",(ch1,ch2)); } 则下列叙述正确的为()
-
1、已知字母A的ASCII码为十进制的65,下面程序的输出是 include<stdio.h> void main() {char ch1,ch2; ch1='A'+'5'-'3'; ch2='A'+'6'-'3'; printf("%d,%c\n",ch1,ch2); }
-
如下程序的输出结果是include<stdio.h>main(){ char ch[2][5]={"6937","8254"},*p[2];int i,j,s=0;for(i=0;i<2;i++) p[i]=ch[i];for(i=0;i<2;i++)for(j=0;p[i][j]>′\0′;j+=2)s=10*s+p[i][j]-′0′;printf("%d\n",s);}
-
以下程序试图把从终端输入的字符输出到名为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); } 出错的原因是()。
-
运行下列程序main(){char ch='B';printf("%c%d",ch,ch++);}的输出是()
-
有以下程序,程序运行结果为()。include “stdio.h”main(){char ch;ch=’s’;switch (ch){ case ’a’: printf(“a=%c/n”,ch);default: printf(“end!/n”);case ’b’: printf(“b=%c/n”,ch);case ’c’: printf(“c=%c/n”,ch);}}
-
70、以下程序的功能是根据输入的“y”或“Y”与“n”或“N“,在屏幕上分别显示出“ This is YES.”与 “ This is NO.”,按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。 include <stdio.h> void YesNo(char ch) { switch (ch) { case 'y': case 'Y': printf("This is YES. \n"); ______________; case 'n': case 'N': printf("This is NO. \n"); } } int main() { char ch; printf("\nEnter a char 'y', 'Y' or 'n', 'N': "); ch = _______________; printf("ch: % c", ch); ____________;
-
阅读下面的程序找出哪一行出错include “stdio.h”void main(){ char ch; 1 printf(“请输入一个字符”); 2 ch=getchar(); 3 printf(“刚刚输入的字符为”); 4 printf(“%f”,ch);}
-
当执行以下程序时,输入 1234567890< 回车 > ,则其中while循环中的printf("")将执行___次. include <stdio.h> int main() { char ch; while((ch=getchar())=='0') printf(""); return 0; }
-
以下程序试图把从终端输入的字符输出到名为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(std
-
5、下面程序的运行结果是 。 include <stdio.h> main() {char ch[7]={“12ab56”}; int i,s=0; for(i=0;ch[i]>=’0’&&ch[i]<=’9’;i+=2) s=10*s+ch[i]-‘0’; printf(“%d”,s); }