C程序设计基础LAB14
1061. Sort Students /* */ /* DON'T MODIFY main function ANYWAY! */ /* */ /***************************************************************/ // ********** Specification of STUDENT ********** // No. …
1061. Sort Students /* */ /* DON'T MODIFY main function ANYWAY! */ /* */ /***************************************************************/ // ********** Specification of STUDENT ********** // No. …
1055. 集合交集 int Intersection(int s1[],int n1,int s2[],int n2,int r[]){ /* PreCondition: 集合元素存放在s1,s2中;n1, n2分别为两个集合大小 PostCondition: s1和s2的交集存放在r中,元素按由小到大存放;返回交集中元素个数 */ } int main() { int n1,n2,i; int …
1051. 矩阵乘法 //********** Specification of multiply ********** void multiply(int (*A)[N], int (*B)[N], int (*C)[N],int n); /* PreCondition: A, B, and C are addresses of three matrices and n (n<=N) is …
1048. 骰子点数之和问题 //********** Specification of Combination ********** double probability(int n, int k); /* Precondition: n和k为整数 Postcondition: 返回n个骰子同时扔后点数之和为k的概率 */ double probability(int n, int k) { / …
1044. grade Finish the definition of the following function which computes the grades of n students for a course given their scores. #include <stdio.h> void grade(int score[], int n, char grade[ …
1039. DisplayBinary Input an integer, and output its binary counterpart. For example, binary for -10 is -1010B. 输入格式 An integer in range [LONGLONG_MIN, LONGLONG_MAX]. 输出格式 Binary counterpart ending wi …
1036. atof Extend atof to handle scientific notation of the form 123.45e-6 where a floating-point number may be followed by e or E and an optionally signed exponent. Write a program to enter a string …
1032.进制转换 定义一个函数h2i,将一个字符串表示的16进制数转换成一个10进制数。 //********** Specification of hex2int ********** unsigned h2i(char s[]); /* PreCondition: s is a string consisting of 0~9,A-F or a-f with at most 8 charac …