虫虫首页| 资源下载| 资源专辑| 精品软件
登录| 注册

Mutli-choice

  • 数组子系统

    #include <stdio.h> #include <stdlib.h> #define SMAX 100 typedef struct SPNode { int i,j,v; }SPNode; struct sparmatrix { int rows,cols,terms; SPNode data [SMAX]; }; sparmatrix CreateSparmatrix() { sparmatrix A; printf("\n\t\t请输入稀疏矩阵的行数,列数和非零元素个数(用逗号隔开):"); scanf("%d,%d,%d",&A.cols,&A.terms); for(int n=0;n<=A.terms-1;n++) { printf("\n\t\t输入非零元素值(格式:行号,列号,值):"); scanf("%d,%d,%d",&A.data[n].i,&A.data[n].j,&A.data[n].v); } return A; } void ShowSparmatrix(sparmatrix A) { int k; printf("\n\t\t"); for(int x=0;x<=A.rows-1;x++) { for(int y=0;y<=A.cols-1;y++) { k=0; for(int n=0;n<=A.terms-1;n++) { if((A.data[n].i-1==x)&&(A.data[n].j-1==y)) { printf("%8d",A.data[n].v); k=1; } } if(k==0) printf("%8d",k); } printf("\n\t\t"); } } void sumsparmatrix(sparmatrix A) { SPNode *p; p=(SPNode*)malloc(sizeof(SPNode)); p->v=0; int k; k=0; printf("\n\t\t"); for(int x=0;x<=A.rows-1;x++) { for(int y=0;y<=A.cols-1;y++) { for(int n=0;n<=A.terms;n++) { if((A.data[n].i==x)&&(A.data[n].j==y)&&(x==y)) { p->v=p->v+A.data[n].v; k=1; } } } printf("\n\t\t"); } if(k==1) printf("\n\t\t对角线元素的和::%d\n",p->v); else printf("\n\t\t对角线元素的和为::0"); } int main() { int ch=1,choice; struct sparmatrix A; A.terms=0; while(ch) { printf("\n"); printf("\n\t\t      稀疏矩阵的三元组系统       "); printf("\n\t\t*********************************"); printf("\n\t\t      1------------创建          "); printf("\n\t\t      2------------显示          "); printf("\n\t\t      3------------求对角线元素和"); printf("\n\t\t      4------------返回          "); printf("\n\t\t*********************************"); printf("\n\t\t请选择菜单号(0-3):"); scanf("%d",&choice); switch(choice) { case 1: A=CreateSparmatrix(); break; case 2: ShowSparmatrix(A); break; case 3: SumSparmatrix(A); break; default: system("cls"); printf("\n\t\t输入错误!请重新输入!\n"); break; } if (choice==1||choice==2||choice==3) { printf("\n\t\t"); system("pause"); system("cls"); } else system("cls"); } }

    标签: 数组 子系统

    上传时间: 2020-06-11

    上传用户:ccccy

  • 50W隔离型离线式DC.pdf

    ABSTRACTThe flyback power stage is a popular choice for single and multiple output dc-to-dc converters at powerlevels of 150 Watts or less. Without the output inductor required in buck derived topologies, such as theforward or push-pull converter, the component count and cost are reduced. This application note will reviewthe design procedure for the power stage and control electronics of a flyback converter. In these isolatedconverters, the error signal from the secondary still needs to cross the isolation boundary to achieveregulation. By using the UC3965 Precision Reference with Low Offset Error Amplifier on the secondaryside to drive an optocoupler and the UCC3809 Economy Primary Side Controller on the primary side, asimple and low cost 50 Watt isolated power supply is realized.

    标签: 隔离

    上传时间: 2021-11-24

    上传用户:kingwide

  • 高通(Qualcomm)蓝牙芯片QCC5151_硬件设计详细指导书(官方内部培训手册)

    高通(Qualcomm)蓝牙芯片QCC5151_硬件设计详细指导书(官方内部培训手册)共52页其内容是针对硬件设计、部分重要元器件选择(ESD,Filter)及走线注意事项的详细说明。2 Power management 2.1 SMPS 2.1.1 Components specification 2.1.2 Input power supply selection 2.1.3 Minimize SMPS EMI emissions 2.1.4 Internal LDOs and digital core decoupling 2.1.5 Powering external components 2.2 Charger 2.2.1 Charger connections.2.2.2 General charger operation2.2.3 Temperature measurement during charging 2.3 SYS_CTRL 3 Bluetooth radio3.1 RF PSU component choice 3.2 RF band-pass filter3.3 Layout (天线 走线的注意事项)4 Audio4.1 Audio bypass capacitors 4.2 Earphone speaker output4.3 Line/Mic input 4.4 Headphone output optimizition5 LED pads 5.1 LED driver 5.2 Digital/Button input 5.3 Analog input5.4 Disabled 6 Reset pin (Reset#)7 QSPIinterface 8 USB interfaces 8.1 USB device port8.1.1 USB connections8.1.2 Layout notes8.1.3 USB charger detection

    标签: qualcomm 蓝牙芯片 qcc5151

    上传时间: 2022-01-24

    上传用户:XuVshu

  • 基于RS-485总线的MODBUS通信协议在单片机上的实现

    以仓库智能改造为背景,主要介绍单片机和上位机之间通信网络和通信协议的选择,MODBUS协议通信指令和功能码使用,重点阐述了基于RS-485总线的MODBUS通信协议在上位机和单片机之间的串行通信,实现上位机对单片机设备的远程控制和信息采集的功能。Based on the intelligent warehouse transformation as the background,mainly introduces between MCU and PC communication network and the choice of communication protocol,instruction and the function code using the MODBUS protocol communication,expounds the MODBUS communication protocol based on RS-485 bus serial communication between PC and single chip microcomputer,PC remote control of single chip computer equipment and the function of information collection.

    标签: RS-485总线 modbus 单片机

    上传时间: 2022-03-26

    上传用户:

  • 高通蓝牙芯片QCC5144_硬件设计指导书

    高通(Qualcomm)蓝牙芯片QCC5144_硬件设计详细指导书(官方内部培训手册)其内容是针对硬件设计、部分重要元器件选择(ESD,Filter)及走线注意事项的详细说明。2 Power management 2.1 SMPS 2.1.1 Components specification 2.1.2 Input power supply selection 92.1.3 Minimize SMPS EMI emissions 2.1.4 Internal LDOs and digital core decoupling 2.1.5 Powering external components 2.2 Charger 2.2.1 Charger connections.2.2.2 General charger operation2.2.3 Temperature measurement during charging 2.3 SYS_CTRL 3 Bluetooth radio3.1 RF PSU component choice 3.2 RF band-pass filter3.3 Layout (天线 走线的注意事项)4 Audio4.1 Audio bypass capacitors 4.2 Earphone speaker output4.3 Line/Mic input 4.4 Headphone output optimizition5 LED pads 5.1 LED driver 5.2 Digital/Button input 5.3 Analog input5.4 Disabled 6 Reset pin (Reset#)7 USB interfaces7.1 USB device port7.1.1 USB device port7.1.2 Layout notes 7.1.3 USB charger detectionA QCC5144 VFBGA example schematic and BOM B Recommended SMPS components specificationB.1 Inductor specifition B.2 Recommended inductors B.3 SMPS capacitor specifition

    标签: 蓝牙芯片 qcc5144

    上传时间: 2022-04-07

    上传用户:默默