编写函数arraycopy(int(*a)[N],int*b,int m)实现把二维数组的M行N列数据复制到一维数组b中。
编写函数arraycopy(int(*a)[N],int*b,int m)实现把二维数组的M行N列数据复制到一维数组b中。
编写函数arraycopy(int(*a)[N],int*b,int m)实现把二维数组的M行N列数据复制到一维数组b中。
第1题
第2题
请编写函数void fun(int x, int pp[], int *n),它的功能是:求出能整除x且不是偶数的各整数,并按从小到大的顺序放在即所指的数组中,这些除数的个数通过形参n返回。
例如,若x中的值为30,则有4个数符合要求,它们是1, 3,5,15。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include <conio.h>
include <stdio.h>
void fun (int x, int pp[], int *n)
{
}
main()
{
int x,aa[1000], n, i ;
clrscr();
printf("\nPlease enter an integer
number : \n ") ;
scanf ("%d", &x) ;
fun (x, aa, &n) ;
for (i=0 ; i<n ; i++)
printf ("%d ", aa [i]);
printf ("\n ") ;
}
第3题
第4题
题目内容 定义结构体Birthday,包含成员年份int year、月份int month、日int day。编写一个函数bool judgement(Birthday b1, Birthday b2),其功能是判断两个人是否同年同月同日生,如果是返回ture,否则返回false。 输入样例1: 1989 09 08 1987 10 11 输出样例1: 不是同月同日生 输入样例2: 1989 09 08 1989 09 08 输出样例1: 是同月同日生
第5题
第6题
第7题
第8题
请编写函数fun(),该函数的功能是:移动字符串中的内容,移动的规则是把第1到第m个字符,平移到字符串的最后,把第m+1到最后的字符移到字符串的前部。
例如,字符串中原有的内容为ABCDEFGHIJK,m的值为 3,移动后,字符串中的内容应该是DEFGHIJKABC。
注意:部分源程序给出如下。
请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。
试题程序:
include <stdio. h>
include <string.h>
define N 80
void fun (char *w, int m)
{
}
main ()
{
char a[N]= "ABCDEFGHIJK";
int m;
printf ("The origina string : \n");
puts (a);
printf("\n\nEnter m: ");
scanf ("%d", &m);
fun (a, m);
printf (" \nThe string after moving : \n");
puts (a);
printf ("\n\n");
}
第9题
A.<class ‘float’>
B.<class ‘bool’>
C.<class ‘str’>
D.<class ‘int’>
第10题