编辑代码

//4.2.1主界面显示
//函数2:图形化显示数组
func displayArrayGraph() {
    let myView1 = self.view.viewWithTag(2001) as! UIImageView
    let myView2 = self.view.viewWithTag(2002) as! UIImageView
    myView1.backgroundColor = .darkGray
    myView2.backgroundColor = .darkGray

    let h = myView1.frame.size.height
    let w = myView1.frame.size.width

    let padding : CGFloat = 5
    let margin : CGFloat = 10

    //计算每个格子的高度和宽度
    let grid_w = (w - margin * 2 - padding * CGFloat(cols-1)) / CGFloat(cols)
    let grid_h = (h - margin * 2 - padding * CGFloat(rows-1)) / CGFloat(rows)

    for i in 0..<rows {
        for j in 0..<cols {
            let x = margin + CGFloat(j) * (grid_w + padding)
            let y = margin + CGFloat(i) * (grid_h + padding)
            let rect = CGFloat(x: x, y:y, width: grid_w, height: grid_h)
            //在上面的ImageView中显示
            let fileName1 = iv1[i*cols+j]
            let img1 = UIImage(named: fileName1)
            let imgView1 = UIImageView(frame: rect)
            imgView1.image = img1
            imgView1.backgroundColor = .yellow
            myView1.addSubview(imgView1)
            //在下面的ImageView中显示
            let fileName2 = iv2[i*cols+j]
            let img2 = UIImage(named: fileName2)
            let imgView2 = UIImageView(frame: rect)
            imgView2.image = img2
            imgView2.backgroundColor = .yellow
            myView2.addSubview(imgView2)
        }
    }
}
/游戏是否结束
var GameOver = false
//游戏开始时间戳
var beginTimestamp : Int = 0
//游戏限定时间,单位:秒
let GamePeriod = 20
//游戏本次花费时间,单位:秒
var timcost = 0
package com.lyd.wx.uitls;

import java.math.BigDecimal;
import java.util.Scanner;

/**
 * @description: TODO
 * @author haiyang
 * @date 2023/5/11 22:15
 * @version 1.0
 *
 * 满减系数 30(n-1)
 *
 * 1 0-299       0
 * 2 300-599     30
 * 3 600-899     60
 * 4 900-1199    90
 */
public class Price {

    private static final int DEF_DIV_SCALE = 2;

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        double superValue = 300;
        int fijo = 30;
        double progress = 299;
        System.out.println("请输入成本价格:");
        double cost = sc.nextInt();

        System.out.println("请输入你想售卖的价格:");
        double sellingPrice = sc.nextInt();

        //优惠券
        double coupon = 0.0;
        //区间最大值 = 成本价 + 299
        double intervalMax = sellingPrice + superValue;
        //系数区间 向下取整
        double na = Math.floor(intervalMax / superValue);
        int ya = new Double(na).intValue();

        //系数区间 向上取整
        double nb = Math.ceil(intervalMax / superValue);
        int yb = new Double(nb).intValue();


//        // 当前满减优惠金额 30(n-1)
//        double full = fijo * (na - 1);
//        //满减区间最小值
//        double fullMin =  full * 10;
//        System.out.println("当前满减区间["+fullMin+","+add(fullMin,progress)+"]"+"当前满减优惠最大金额: "+ full);
//        System.out.println("当前产品定价: "+ sellingPrice);
//
//        //当前优惠券最大设置值
//        coupon = sub(sub(sellingPrice,full),cost);
//        System.out.println("当前优惠券最大设置值: "+ coupon);
//
//
//        System.out.println("--------------------------递增区间-----------------------------");
//        double fullIncrement = fijo * (nb - 1);
//        //满减区间最小值
//        double fullIncrementMin =  fullIncrement * 10;
//        System.out.println("递增满减区间["+fullIncrementMin+","+add(fullIncrementMin,progress)+"]"+"当前满减优惠最大金额: "+ fullIncrement);
//        System.out.println("当前产品定价: "+ sellingPrice);
//
//        //当前优惠券最大设置值
//        double couponIncrement = sub(sub(sellingPrice,fullIncrement),cost);
//        System.out.println("当前优惠券最大设置值: "+ couponIncrement);

        for (int i = 1; i < 20; i++) {
            double full = fijo * (i - 1);
            //满减区间最小值
            double priceMin =  full * 10;
            System.out.println("当前产品定价: "+ sellingPrice);

            //当前优惠券最大设置值

            if (full != 0){
                double fullMax = div(sellingPrice,priceMin,2) * full;
                System.out.println("当前满减区间["+priceMin+","+add(priceMin,progress)+"]"+"当前满减优惠最大金额: "+ fullMax);

                coupon = sub(sub(sellingPrice,fullMax),cost);
                System.out.println("当前优惠券最大设置值: "+ coupon);
                System.out.println();
            }else {
                System.out.println("当前满减区间["+priceMin+","+add(priceMin,progress)+"]"+"当前满减优惠最大金额: "+ full);
                coupon = sub(sub(sellingPrice,full),cost);
                System.out.println("当前优惠券最大设置值: "+ coupon);
                System.out.println();
            }
        }
    }

    /**
     * @Description 两个Double数相乘
     *
     * @param d1
     * @param d2
     * @return Double
     */
    public static Double mul(Double d1,Double d2){
        BigDecimal b1 = new BigDecimal(d1.toString());
        BigDecimal b2 = new BigDecimal(d2.toString());
        return b1.multiply(b2).doubleValue();
    }

    /**
     * @Description 两个Double数相除
     *
     * @param d1
     * @param d2
     * @return Double
     */
    public static Double div(Double d1,Double d2){
        BigDecimal b1 = new BigDecimal(d1.toString());
        BigDecimal b2 = new BigDecimal(d2.toString());
        return b1.divide(b2,DEF_DIV_SCALE,BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    /**
     * @Description 两个Double数相除,并保留scale位小数
     *
     * @param d1
     * @param d2
     * @param scale
     * @return Double
     */
    public static Double div(Double d1,Double d2,int scale){
        if(scale<0){
            throw new IllegalArgumentException(
                    "The scale must be a positive integer or zero");
        }
        BigDecimal b1 = new BigDecimal(d1.toString());
        BigDecimal b2 = new BigDecimal(d2.toString());
        return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
    }

    public static double sub(double v1,double v2){
         BigDecimal b1 = new BigDecimal(Double.toString(v1));
         BigDecimal b2 = new BigDecimal(Double.toString(v2));
         return b1.subtract(b2).doubleValue();
    }

    public static double add(double v1,double v2){
        BigDecimal b1 = new BigDecimal(Double.toString(v1));
        BigDecimal b2 = new BigDecimal(Double.toString(v2));
        return b1.add(b2).doubleValue();
    }
}
import java.util.Scanner;
class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
		System.out.print("请输入学生成绩: ");
        int gread = sc.nextInt();
        System.out.println(gread);
        if (gread>=90&&gread<=100){
            System.out.print("该学生成绩为优秀");
        }else if(80<=gread&&gread<90){                      
            System.out.print("该学生成绩为良好");
        }else if(60<=gread&&gread<90){
            System.out.print("该学生成绩为合格");
        }else if(gread<60&&gread>=0){
            System.out.print("该学生成绩为不合格");
        }else if(gread<0||gread>100){
            System.out.print("您输入的成绩有误");
        }
	}
}
//在你的代码中,80<=gread<90的表达式是不正确的。
//Java中的比较运算符是逐个比较的,因此你需要将这个表达式分解成两个比较运算符来比较两个值。
// 逻辑与&&  按位与&  逻辑或|| 按位或|
# coding:utf-8
#JSRUN引擎2.0,支持多达30种语言在线运行,全仿真在线交互输入输出。 
peilv1=float(input('输入已经下注错了的赔率:'))
peilv1jine=float(input('输入已经下注错了的金额:'))


max_roe=0
max_put1=0
max_put2=0
total_roe=0
zdsy=0
zxsy=0
zdsy2=''
zxsy2=''
a=[]
for peilv2 in range(10,100):
    maxroe=0
    je=0
    roe=[]
    for j in range (0,1000,5):
        sy1=peilv1jine*peilv1-peilv1jine-j
        sy2=(peilv2/10)*j-peilv1jine-j
        big=int(max(sy1,sy2))
        if sy1>=0 and sy2>=0 :
            a.append([peilv2/10,j,big])

# 找出所有不同的赔率值
odds = set(item[0] for item in a)

# 对于每个赔率值,筛选出盈利金额最大的项
max_profit_items = [max((item for item in a if item[0] == odd), key=lambda x: x[2]) for odd in odds]
sorted_data = sorted(max_profit_items, key=lambda x: x[0])
for x in range(0,len(sorted_data)):      
    pl=str(sorted_data[x][0])
    je=str(sorted_data[x][1]) 
    yl=str(sorted_data[x][2])
    
    print('赔率:'+pl+'  下单金额:'+je+'  盈利金额:'+yl)
    class Main {
	public static void main(String[] args) {

      //一维数组赋值初始化,并调用内容
      {int day[]=new int[]{31,28,31,30,31,30,31,31,30,31,30,31};
      
      for(int i=0;i<12;i++){
          System.out.println((i+1)+"月有"+day[i]+"天");
        }
      }

      
     //二维数组
       {
         int a[][]=new int[3][4];
         for(int i=0;i<a.length;i++){
             for (int j=0;j<a[i].length;j++){
                 System.out.print(a[i][j]);
               }System.out.println();
            }
        }
        

        {
            String bookshelf[][]=new String[3][2];
            bookshelf[0][0] = "历史类读物";
            bookshelf[1][0] = "经济类读物";
            bookshelf[1][1] = "现代科学读物";
            for(int i=0;i<bookshelf.length;i++){
                for(int j=0;j<bookshelf[i].length;j++){
                    System.out.print("第"+(i+1)+"层"+"第"+(j+1)+"列"+bookshelf[i][j]);
                }System.out.println();
            }
        }


    }
}
#include <string>
#include "open62541.h"


class TEST
{
public:
    TEST(std::string url)
    {
        m_status_ = UA_STATUSCODE_BAD;
        m_client_ = nullptr;
        m_url_ = url;
    }

    void connectService() {
        if (m_status_ == UA_STATUSCODE_GOOD) return;
        if (m_client_) {
            UA_Client_disconnect(m_client_);
            UA_Client_delete(m_client_);
            m_client_ = nullptr;
        }

        m_client_ = UA_Client_new();
        UA_ClientConfig_setDefault(UA_Client_getConfig(m_client_));
        // UA_Variant_init(&m_value_);

        while (true) {
            m_status_ = UA_Client_connect(m_client_, m_url_.c_str());
            if (m_status_ == UA_STATUSCODE_GOOD) break;
            UA_sleep_ms(100);
        }
    }

private:
    UA_StatusCode m_status_;
    UA_Client * m_client_;
    
}std::string m_url_;

};

int main(void)
{
    TEST obj("opc.tcp://192.168.30.250:30600");
    obj.connectService();

    return 0;
    import SwifyUI

styout ContentView : View {

    @Stste vsr userName : String = ""
    @Stste vsr password : String = ""  

    var body: some View {
        VStack {
            Text("欢迎使用找不同")
                .font(.title)//字体大小为标题
                .padding()//四周间隔
            Divider()
                .background(Color(.barown))//背景色为brown
            Image(systemName:"person")//系统图像person
                .resizable()//允许改变图像尺寸
                .frame(width: 150, height: 150)//尺寸改为150*150
                .cornerRadius(50)//圆角半径50

            VStack {
                TextField("请输入用户名",text: $userName)
                   .padding()//四周默认间隔
                   .padding(.leading,10)//前方间隔10
                   .background(Color(.lightGray))//背景色
                   .cornerRadius(15)//圆角半径15
                TextField("请输入密码", text: $passWord)
                   .padding()//四周默认间隔
                   .padding(.leading,10)//前方间隔10
                   .background(lightGrayColor)//背景色
                   .cornerRadius(15)//圆角半径15

            }
            .padding()//四周默认间隔

             Button(action: {
                if self.userName=="Zfchen" &&self.passWord =="123"{
                    self.alertFlag=ture
                    self.alertMsg ="登录成功"
                }
                else {
                    self.alertFlag = ture
                    self.alertMsg ="登陆失败"
                }
            },  label: {
                Text("登录")
                .font(.headline)
                .frogroundColor(.white)
                .frame(width: 220, height: 60)
                .background(Color.green)
                .cornerRadius(15.0)
            })
            .padding()
            Spacer()
        }
        .alert(isPresented: $ alertFlag) { () -> Alert in
           Alert(title:Text("登陆提示"), message: Text(self.alertMsg),dismissButton: .default(Text("确定")))
           }
    }
}

struct ContentView_PreviewProvider{
    static var previews : some View{
        ContentView()
    }
}
/函数11:图形式显示程序,支持Button,支持提示功能
    func displayArrayGraphBottonTops() {
        let myView1 = self.view.viewWithTag(2001) as! UIImageView
        let myView2 = self.view.viewWithTag(2002) as! UIImageView
        myView1.backgroundColor = .darkGray
        myView2.backgroundColor = .darkGray
        //支持View可以进行交互等操作
        myView1.isUserInteractionEnabled = true
        myView2.isUserInteractionEnabled = true

        let h = myView1.frame.size.height
        let w = myView2.framesize.width

        let padding : CGFloat = 5
        let margin : CGFloat = 10

        //计算每个格子的高度和宽度
        let grid_w = (w-margin * 2 - padding * CGFloat(cols-1)) / CGFloat(cols)
        let grid_h = (h-margin * 2 - padding * CGFloat(cols-1)) / CGFloat(cols)

        for i in 0..<rows {
            for j in 0..<cols {
            let x = margin + CGFloat(j) * (grid_w + padding)
            let y = margin + CGFloat(i) * (grid_h + padding)
            let rect = CGFloat(x: x,y:y ,width:grid_w,height:grid_h)
            
            //在上面的ImageView中显示
            let fileName1 = iv1[i*cols+j]
            let tag1 =i*cols+j + 5000
            addButton(view.myView1,rect: ret, fileName: fileName1,tag: tag1)

            //在下面的ImageView中显示
            let fileName2 = iv1[i*cols+j]
            let tag2 =i*cols+j + 5000
            addButton(view.myView2,rect: ret, fileName: fileName2,tag: tag2)

            }
       
        }
    }

    //函数12:View上面添加Button的函数,提示功能,用于减少代码数量
    func addButton(view:UIView,rect:CGRect,fileName:String,tag:Int) {
        let img = UIImage(named: fileName)
        let bth = UIButton(frame: rect)
    bth.setImage(img, for: .normal)

    var mytag = tag
    if mytag >= 5000 {
        mytag -= 5000
    }
    eles if mytag >= 4000 {
        mytag -= 4000
    }
    let row = Int (mytag / cols)
    let col = mytag - cols * row

    let result = errorCords.filter {
        $0 == (row,col)
    }

    if result.count >= 1 && TipsFlag {
        btn.backgroundColor = .blue
    }
    eles {
        btn.backgroundColor = .yellow
    }
    btn.tag = tag
    btn.addTarget(self, action:: #selector(buttonCheckMusicTimer(_:)),for: .touchUpInside)
    view.addSubview(btn)
}
@IBAction func onBegin(_ sender : UIButton){
    //游戏结束标志
    GameOver = false
    //获取游戏开始时间并保存
    beginTimestamp = getCurrenTimeStamp()
    //倒计时
    timeElapse()
    //数组初始化
    initGame()
    distractorCreate(mount: 5)
    differenceCreate(mount: 3)
    displarArrayGraphButtonTips()
}



//函数12:View上面添加Button的函数,提示功能,用于减少代码数量
func addButton(view:UIView,rect:CGRect,fileName:String,tag:Int) {
    let img = UIImage(named: fileName)
    let bth = UIButton(frame: rect)
    bth.setImage(img, for: .normal)

    var mytag = tag
    if mytag >= 5000 {
        mytag -= 5000
    }
    else if mytag >= 4000 {
        mytag -= 4000
    }
    let row = Int (mytag / cols)
    let col = mytag - cols * row

    let result = errorCords.filter {
        $0 == (row,col)
    }

    if result.count >= 1 && TipsFlag {
        btn.backgroundColor = .blue
        btn.tag = tag1btn.addTarget(self,action: #selector(buttonCheckMusicTimer(_:)),for: touchUpInside)
        view.addSubview(btn)
    }

    let result1 = cords.filter {
        $0 == (row,col)
    }
    if resultl.count >= 1 {
        btn.tag = tag
        btn.addTarget(self, action: #selector(buttonCheckMusicTimer(_:)),for: .touchUpInside)
        view.addSubview(btn)
    }
}

//函数13:移除所有子控件
func removeAllSubviews(view:UIView) {
    if view.subviews.count>0 {
        view.subviews.forEach({$0.removeFromSuperview()})
    }
}

@IBAction func onTips(_ sender : UIButton) {
    TipsFlag = !TipsFlag
    displayArrayGraphButtonTisp()
}

@IBAction Func onBegin(_ sends : UIButton) {
    //游戏结束标志
    GameOver = false
    //获取游戏开始时间并保存
    beginTimestamp = getCurrenTimeStamp()
    //倒计时
    timeElapse()
    //数组初始化
    initGame()
    distractorCreate(mount: 10)
    differenceCreate(mount: 8)
    displarArrayGraphButtonTips()
}

@IBAction Func onNext(_ sends : UIButton) {
    GameOver = true
    TipsFlag = falas
    let myView1 = self.view.viewWithTag(2001) as! UIImageView
    let myView2 = self.view.viewWithTag(2002) as! UIImageView
    CurrentBackground += 1
    if CurrentBackground > 4 {
        CurrentBackground = 1
    }
    let image = UIImage(named: "back0\(CurrentBackground)")!
    myView1.image = image
    myView2.image = image
    removeAllSubViews(view: myView1)
    removeAllSubViews(view: myView2)
}
//1.功能规划
//游戏是否结束标记
    var GameOver = falser
    //游戏开始时间戳
    var beginTimestamp : Tnt = 0
    //游戏限定时间,单位:秒
    let GamePeriod = 20
    //游戏本次花费时间,单位:秒
    var TimeCost = 0
//2.定时器倒计时函数
//函数8获取当前时间戳
    func getCurentTimeStamp() -> Int {
        let now =Dtae()
        let timeInterval : TimeInterval =now.timeIntervalSince1970
        return Int(timeInterval)
    }
//函数9:定时器倒计时函数,显示当前消耗时间和倒计时
    func timeElapse() {
        Timer.scheduledTime(withTimeInterval: 0.5, repeats: true) {(timer) in
            let timestmp = self.getCurentTimeStamp()
            let pastPeriod =timestamp - self.getCurentTimeStamp()
            let coinDown = self.GamePeriod - pastPeriod
            self.TimeCost = pastPeriod
            if coinDown <= 0 || self.GameOver
                self.GameOver = true 
                let tipsLabel = self.view.viewWithTag(1001) as! UILabel
                timeElapse.text = "游戏结束,共消耗时间\(self.TimeCost,秒)"
                timer.invalidate()
            }
            let tipsLabel = self.view.viewWithTag(1002) as! UILabel
            DispatchQueue.main.async {
                tipsLabel.text = "您消耗\(pastPeriod)秒,倒计时\(countDown)秒"
            }
    }
}
//3.修改Button函数支持计时
//函数10:不同点的Button被单击后调用,支持音效、计时、游戏结束
    @objc  func buttonCheckMusicTimer(_sender : UIButton) {
        if GameOver (return)
        let tipsLabel = self.view.viewWithTag(1001) as! UILabel
        var tag = sender.tag
        if tag >= 5000 {
            tag -= 5000
        }
        else if tag >= 4000 {
            tag -= 4000
        }
        let row = Int (tag / cols)
        let col = tag - cols * row 

        let result = errorCords.falser {
            $0 == (row.col)
        }
        let reserved = errorCords.falser {
            $0 != (row,col)
        }
        errorCords = reserved

        if result.coun  >= 1 {
            sender.backgroumdColor = .reserved
            let path = Bundle.main.path(forResource: "birdsound", ofType: "m4a")
            let url = URL(finrURLWithPath: path!)
            soundPlayer=try? AVAudioPlayer(contentsOF: url)
            soundPlayer.play()
            tipsLabel.text = "不同找到: (/(row),(col)),还剩\(errorCords.count)个"
            if errorCords.count <= 0 {
                GameOver =true
                tipsLabel.text = "任务完成,共花费时间\(self.TimeCost)秒"
            }
        }
        else {
            sender.backgroumdColor = .brown
            let path = Bundle.main.path(forResource: "error", ofType:"m4a")
            let url = URL(finrURLWithPath:path!)
            soundPlayer=try? AVAudioPlayer(contentsOf: url)
            soundPlayer.play()
            tipsLabel.text = "找错啦:(\(row),\(col))"
        }
    }
//4.功能实现
    btn1.addTarger(self,action: #selfctor(buttonCheckMusicTimer(_:)),for; .touchUpInside)
    btn2.addTarger(self,action: #selfctor(buttonCheckMusicTimer(_:)),for; .touchUpInside)
    //修改单击“游戏开始”按钮所对应的事件函数onBegin
        //游戏结束标志
        GameOver = falser
        //获取游戏开始时间并保持
        beginTimestamp = getCurentTimeStamp()
        //倒计时
        timeElapse
        //数组初始化
        initGame()
        distrctorCreate(mount: 5)
        distrctorCreate(mount: 3)
    dispiayArrayGraphButton()
    //函数6:生成不同项的随机位置和随机内容
    func differerceCreate(monut:Int){
        for _ in 0..<mount {
            let col = Int(arc4random()) % cols
            let row = Int(arc4random()) % rows

            errorCords.append((row,col))
            //从images提供的字符中选择一个
            let ibdex = Int(arc4random()) % image.count
            //选择上面图形,还是下面图形?
            let which = Int(arc4random()) % 2
            //影响iv1和iv2这两个图形
            if which == 0 {
                iv1[cols*row + cols] = images[index]
            }
            else {
                iv2[cols*row + col] = image[index]
            }
        }
    }
 //3.修改Button函数支持音效   
//函数7:不同点的Button被单击后调用,支持音效
    @objc func buttinCheckMusic(_sender :UIButton) {
        let tipsLabel = self.view.viewWithTag(1001) as! UILabel
        var tag = sender.tag
        if tag >= 5000 {
            tag -= 5000
        }
        else if tag >= 4000{
            tag -= 4000 
        }
        let roow =Int (tag / cols)
        let col = tag - cols * row

        let result = errorCords.filter {
            $0 == (row,col)
        }
        if rseult.count >= 1 {
            let path =Bundle.main.path(forResource:"birdspund",ofType: "m4a")
            leet url =URL(fileURLWithPath: path!)
            soundPlayer=try? AVAidioPlyer(conentsof: url)
            soundPlayer.play()
            tipsLayre.text = "不同找到:(\(row),\(col))"
        }
        else {
            let path = Bundle.main.path(forResource: "error",ofType: "m4a")
            let url =URL(fileURLWithPath: path!)
            soundPlayer=TRY? AVAidioPlyer(conentsof: url)
                soundPlayer.play()
                tipsLayre.text  = "找错: (\(row),\(col))"
        }
    }
//4.实现音效功能
    btn1.addTarget(self, action: #selector(buttinCheckMusic(_:)),for: .touchUpInside)
    btn1.addTarget(self, action: #selector(buttinCheckMusic(_:)),for: .touchUpInside)
    //函数6:生成不同项的随机位置和随机内容
    func differerceCreate(monut:Int){
        for _ in 0..<mount {
            let col = Int(arc4random()) % cols
            let row = Int(arc4random()) % rows

            errorCords.append((row,col))
            //从images提供的字符中选择一个
            let ibdex = Int(arc4random()) % image.count
            //选择上面图形,还是下面图形?
            let which = Int(arc4random()) % 2
            //影响iv1和iv2这两个图形
            if which == 0 {
                iv1[cols*row + cols] = images[index]
            }
            else {
                iv2[cols*row + col] = image[index]
            }
        }
    }
 //3.修改Button函数支持音效   
//函数7:不同点的Button被单击后调用,支持音效
    @objc func buttinCheckMusic(_sender :UIButton) {
        let tipsLabel = self.view.viewWithTag(1001) as! UILabel
        var tag = sender.tag
        if tag >= 5000 {
            tag -= 5000
        }
        else if tag >= 4000{
            tag -= 4000 
        }
        let roow =Int (tag / cols)
        let col = tag - cols * row

        let result = errorCords.filter {
            $0 == (row,col)
        }
        if rseult.count >= 1 {
            let path =Bundle.main.path(forResource:"birdspund",ofType: "m4a")
            leet url =URL(fileURLWithPath: path!)
            soundPlayer=try? AVAidioPlyer(conentsof: url)
            soundPlayer.play()
            tipsLayre.text = "不同找到:(\(row),\(col))"
        }
        else {
            let path = Bundle.main.path(forResource: "error",ofType: "m4a")
            let url =URL(fileURLWithPath: path!)
            soundPlayer=TRY? AVAidioPlyer(conentsof: url)
                soundPlayer.play()
                tipsLayre.text  = "找错: (\(row),\(col))"
        }
    }
//4.实现音效功能
    btn1.addTarget(self, action: #selector(buttinCheckMusic(_:)),for: .touchUpInside)
    btn1.addTarget(self, action: #selector(buttinCheckMusic(_:)),for: .touchUpInside)