1.首先定义一个学生结构体(结构体中包含一个Score结构体): typedef struct score{ float chinese;//语文成绩 float english;//英语成绩 float history;//历史成绩 }Score; typedef struct stu{ char name[20];//姓名 char sex;//性别 Score _score;//分数 } Student; 2.定义一个找出成绩至少2门不及格的学生信息的函数 void getStudents…
1.表结构: /*学生*/ create table student( sno int not null primary key, sname ) ); /*课程*/ create table center( cno int not null primary key, cname ) ); /*分数*/ create table sgrade( sno int , cno int , sgrade int ); 2.插入数据: ,'a'); ,'b'); ,'c') ,'aa'); ,'bb')…
import java.util.Scanner; /** * @author 冰樱梦 * 时间:2018年下半年 * 题目:找出分数最高的前两个学生 * */ public class Exercise05_09 { public static void main(String[] args){ String name,first = null,second = null; Scanner input=new Scanner(System.in); double score; double m…
//函数fun功能:找出一个大于给定整数m且紧随m的素数,并作为函数值返回. #include <stdlib.h> #include <conio.h> #include <stdio.h> int fun( int m) { int i,k; ; ;i++)//取大于m的逐个数 { ;k<i;k++)//判断是否为素数质数 /*************found**************/ ) break; /*************found******…
题目为:  有一百个图片文件,它们的地址都是http://down.fengge.com/img/1.pnghttp://down.fengge.com/img/2.png…一直到http://down.fengge.com/img/100.png批量下载这100个图片文件,并找出其中大于200KB的文件.  这个使用shell脚本实现 #!/bin/bash ..} do wget http://down.fengge.com/img/$i.png done find ./ -name "*.…
题意: 有n个人围成一圈 顺序排号 从第1个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位. 算法实现: (一)一种是按照链表数据结构(一)线性表循环链表之约瑟夫环 (二)使用数组实现 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <string.h> int getLast(int *p, int n) { ,index=…
前提: 求任意的一个m×n矩阵的鞍点——鞍点是指该位置上的元素在该行上为最大.在该列上为最小, 矩阵中可能没有鞍点,但最多只有一个鞍点. m.n(<=m<=.<=n<=)及矩阵元素从键盘输入(只考虑int型和每行.每列中没有并列最大/最小的情况). 算法实现: #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <math.h> #defi…
分别用while,do-while,for语句实现 方法一:while #include<stdio.h> int main() { int m; m = ; ) { == ) printf("%5d", m); m = m + ; } } 方法二:do-whlie #include<stdio.h> int main() { int m; m = ; do { == ) printf("%5d", m); m = m + ; } ); }…
#include<stdio.h> int main() { int i, j, t; ; i <= ; i++) { ; ; j < i; j++) { ) { t = ; break; } } ) { printf("%d\n", i); } } }…
什么是水仙花数? 水仙花数是指一个 3 位数,它的每个位上的数字的 3次幂之和等于它本身(例如:1^3 + 5^3+ 3^3 = 153). 代码1: #include<stdio.h> int main() { int m,a, b, c; m = ; printf("1000以内水仙花数为:\n"); ) { a = m / ; b = m / % ; c = m % ; if (m == a * a * a + b * b * b + c * c * c) print…