程序程序运行后,如果从键盘上输入2,4;则输出结果是:sum=##,i=##。#include<stdio.h>intmain{ints=0,t=1,a,n,i;scanf(%d,%d,&a,&n);for(i=1;i<n;i++){t=t*10+1;s=s+t;}s*=a;printf(sum=%d,i=%d\n,s,i);return0;}
运行下面程序时,从键盘输入字母H,则输出结果是:#include<stdio.h>voidmain{charch;ch=getchar;switch(ch){case'H':printf(Hello!\n);case'G':printf(Goodmorning!\n);default:printf(Bye_Bye!\n);}}()
A. Hello!
B. Hello!Good Morning!
C. Hello!
D. Hello!Good morning! Bye_Bye!Bye_Bye!