北航C语言上机1

版权声明:本文为博主原创文章,点个赞随便转 https://blog.csdn.net/qq_20200047/article/details/86574360
题目参考400+复试资料
/***1 2 3 4略****/
//5
/*
#include<stdio.h>
#include<string.h>
int main(){
	char ch;
	char a[1000];
	int k=0,i;
	while((ch=getchar())!=EOF){
		a[k++]=ch;
	}
	a[k]='\0';
	int kong=0,enter=0;
	for(i=0;i<k;i++){
		if(a[i]==' ')kong++;
		else if(a[i]=='\n')enter++;
	}
	printf("%d %d\n",kong,enter-1);
	return 0;
}
*/
//6
#include<stdio.h>
#include<string.h>
int main(){
   unsigned short int x,y,z;
   scanf("%hu%hu",&x,&y);
   x=x>>8;
   x=x<<8;
   y=y>>8;
   z=x+y;
   printf("%hu\n",z);
   return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_20200047/article/details/86574360