题目详情
当前位置:首页 > 职业培训考试
题目详情:
发布时间:2023-10-02 07:42:07

[填空题]输入100名学生的出生月份,统计并输出每个月份过生日的学生人数。 #include<stdio.h> #define N 100 void main( ) { int i,month; int birth[13]={0};/*birth[1]~birth[12]分别保存1~12月过生日的学生数*/ for(i=1;i<=N;i++) { scanf("%d",______); /*第一空*/ if(month>=1&&month<=12)birth[month]++; } for(i=1;______;i++) /*第二空*/ printf("%d month______/n",i,birth[i]); /*第三空*/ }

更多"输入100名学生的出生月份,统计并输出每个月份过生日的学生人数。 "的相关试题:

[单项选择]有以下程序:
# include <stdio.h>
# include <stdio.h>
void fun(int *p1, int *p2; int*s)
s=(int*) malloc(sizeof(int));
*s=*p1+*p2;
free(s);

main( )
int a=1,b=40,*q=&a;
fun(&a,&b,q);
printf("%d/n",*q);

程序运行后的输出结果是( )。


A. 42
B. 0
C. 1
D. 41
[简答题]输入数据:2743<回车>。 #include<stdio.h> main( ) {int c; while((c=getchar( ))!=’n’) {switch(c-’2’) {case 0: case 1:putchar(c+4); case 2:putchar(c+4);break; case 3:putchar(c+3); case 4:putchar(c+2);break;} } printf("/n");}
[简答题]输入数据:2743<回车>。
#include<stdio.h>
main( )
int c;
while((c=getchar( ))!=’n’)
switch(c-’2’)
case 0:
case 1:putchar(c+4);
case 2:putchar(c+4);break;
case 3:putchar(c+3);
case 4:putchar(c+2);break;

printf("/n");
[填空题]输出若干学生3门课程的成绩。
#include <stdio.h>
【9】
struct student
int num;
float score[3];

main ( )
int i=0, n;
float a[3];
【10】 *ptr [200];
printf ("请输入学生学号和3门课成绩,学号为0表示数据输入结束/n");
do
ptr[i]=(struct student *)malloc(sizeof(struct student));
scanf("%d%f%f%f",&ptr[i]->num,&a[O],&a[1],&a[2]);
ptr[i]->score[O]=a[O];
ptr[i]->score[1]=a[1];
ptr[i]->score[2]=a[2];
if( 【11】 ) break;
i++;
while(1);
n=i-1;
【12】 ;
for(i=O;i<=n;i++)
printf("%-6d%.1f %.1f %.1f/n",ptr[i]->num, ptr[i]->score[0],
ptr[i]->score[1], ptr[i]->score[2]);
[单项选择]执行以下程序时输入1234567<CR>,则输出结果是
#include <stdio.h>
main( )
int a=1,b;
scanf("%3d%2d",&a,&b);
printf("%d%d/n",a,b);

A. 12367
B. 12346
C. 12312
D. 12345
[简答题]/*设从键盘输入:420<回车>*/
#include<stdio.h>
main( )
char c;
while((c=getchar( ))!=’/n’)
switch(C-’0’)
case 0:
case 1:putchar(c+2);
case 2:putchar(c+3);break;
case 3:putchar(c+4);
default:putchar(c+1);break;

printf("/n");

[填空题]输入字母a时,下列程序的运行结果为 【3】
#include <stdio.h>
main( )
char ch;
ch=getchar( );
(ch>=’a’&&ch<=’z’)putchar(ch+’A’-’a’):putchar(ch);

[简答题]以下程序运行时输入:12<回车>,执行后输出结果 #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); }
[填空题]

执行以下程序时输入1234567<CR>,则输出结果是 【6】
#include <stdio.h>
main( )
{ int a=1,b;
scanf("%2d%2d",&a,&b); prinff("%d %dhn",a,b);
}


[单项选择]当输入为"Fool&Swalow"时,下面程序的执行结果是( )。
#include<stdio.h>
main( )
char c;
while(c!='')
c=getchar( );
putchar(C) ;


A. Swalow
B. Fool
C. Fool
D. Swalow
[填空题]设有下列程序: #include<stdio.h> #include<string.h> main( ) { int i; char si 10],ti 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>,则程序的输出结果是______。
[简答题]#include<stdio.h> #include<string.h> void main( ) { char*pa,a[20]="Beijing2008"; for(pa=a+7;*pa!=’/0’;pa++)putchar(*pa); putchar(’/n’): }
[单项选择]以下程序
#include<stdio.h>
#include<string.h>
main( )
char*pl="abc",*p2="ABC",str[50]="xyz";
strcpy(str+2.strcat(p1,p2));
printf("%s/n,str);

的输出是______。
A) xyzabcABC B) zabcABC
C) yzabcABC D) xyabcABC
[单项选择]运行下面程序时,从键盘输入字母H,则输出结果是
#include<stdio.h>
main( )
char ch;
ch=getchar( );
switch(ch)
case ’H’:printf("Hello!/n");
case ’G’:printf("Good morning!/n");
default:printf("Bye_Bye!/n");


A. Hello!
B. Hello!
C. Hello!
D. Hello!
[单项选择]运行下面的程序时,从键盘输入字母H,则输出结果是
#include <stdio.h>
main( )
char ch;
ch=getchar( );
switch(ch)
case 'H':printf("Hello!/n");
case 'G':printf("Good moming!/n");
default:printf("Bye_Bye!/n");


A. Hello!
B. Hello!
C. Hello!
D. Hello!
[填空题]设有下列程序:
#include<stdio.h>
#include<string.h>
main( )
int i;
char si 10],ti 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>,则程序的输出结果是______。
[填空题]#include<stdio.h> #include<conio.h> main( ) { int i,j; int sum,k=0; for(i=0;i<5;i++); { printf("input a number:"); scanf("%d",k); sum+=k: } printf("the sum is%d",sum); } 错误:______ 改正:______

我来回答:

购买搜题卡查看答案
[会员特权] 开通VIP, 查看 全部题目答案
[会员特权] 享免全部广告特权
推荐91天
¥36.8
¥80元
31天
¥20.8
¥40元
365天
¥88.8
¥188元
请选择支付方式
  • 微信支付
  • 支付宝支付
点击支付即表示同意并接受了《购买须知》
立即支付 系统将自动为您注册账号
请使用微信扫码支付

订单号:

请不要关闭本页面,支付完成后请点击【支付完成】按钮
恭喜您,购买搜题卡成功
重要提示:请拍照或截图保存账号密码!
我要搜题网官网:https://www.woyaosouti.com
我已记住账号密码