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

Main

  • 数组子系统

    #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

  • C++1000以内的素数

    #include<iostream> using namespace std; int s=0;  int prime(int x){ int i,p=1; for(i=2;i<=x/2;i++){ if(x%i==0){ p=0; break; } } if(p!=0){ cout<<x<< " "; s++; } }  int Main(){ for (int k=5;k<=100;k++){ prime(k); if(s%5==0) cout<<'\n'; } return 0; }

    标签: C++

    上传时间: 2020-06-30

    上传用户:1274636550

  • 轮机英语期末答案

    )Armature windings of the electric motor for NO.2 deck cargo winch found low insulation. Windings re-winded,painted and baked dry. (2) NO.1 Main air compressor failed to build up pressure.The machine disassembled, cleaned and inspected. The discharge valve plate found broken. The valve palte renewed and running trials tested after being reassembled. 

    标签: 答案

    上传时间: 2020-07-14

    上传用户:

  • STM32F407VGT6精确脉冲控制步进电机源码

    STM32F407VGT6精确脉冲控制步进电机源码,采用STM32F407VGT6芯片,抛弃单脉冲输出方式,直接使用普通PWM输出方式精确输出脉冲个数,每个脉冲都可以改变频率和占空比。PWM+中断,简单粗暴。#include "sys.h"#include "delay.h"#include "pwm1.h"#include "pwm2.h"#include "pwm3.h"//注释见pwm1.c文件extern int count2;int Main(void){  delay_init(168);  //初始化延时函数     TIM2_Init(1,167); TIM3_Init(1,167); TIM5_Init(1,167); // delay_ms(1000); TIM2_OUTPUT(); TIM3_OUTPUT(); TIM5_OUTPUT(); while(1) { //TIM2每次输出完10个脉冲后间隔100ms再次输出 if(count2 >= 10){ delay_ms(100); TIM2_OUTPUT(); } }

    标签: stm32f407vgt6 脉冲控制 步进电机

    上传时间: 2021-10-26

    上传用户:xsr1983

  • C语言各知识点详细总结

    C语言各知识点详细总结27页C 语言知识要点复习资料 总体上必须清楚的: 1)程序结构是三种: 顺序结构 、选择结构(分支结构)、循环结构。 2)读程序都要从 Main()入口, 然后从最上面顺序往下读(碰到循环做循环,碰到选择做选择),有 且只有一个 Main 函数。 3)计算机的数据在电脑中保存是以 二进制的形式. 数据存放的位置就是 他的地址. 4)bit 是位 是指为 0 或者 1。 byte 是指字节, 一个字节 = 八个位. 概念常考到的: 1、编译预处理不是 C 语言的一部分,不占运行时间,不要加分号。C 语言编译的程序称为源程 序,它以 ASCII 数值存放在文本文件中。 2、define PI 3.1415926; 这个写法是错误的,一定不能出现分号。 3、每个 C 语言程序中 Main 函数是有且只有一个。 4、在函数中不可以再定义函数。 5、算法:可以没有输入,但是一定要有输出。 6、break 可用于循环结构和 switch 语句。 7、逗号运算符的级别最低,赋值的级别倒数第二。 第一章 C 语言的基础知识 第一节、对 C 语言的基础认识 1、C 语言编写的程序称为源程序,又称为编

    标签: C语言

    上传时间: 2021-11-06

    上传用户:kent

  • 矩阵式键盘

    include<reg52.h> #define uint unsigned int #define uchar unsigned char uint temp,aa,wang,qian,bai,shi,ge; sbit dula=P2^6; sbit wela=P2^7; uchar code table[]={ 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; void display( uint wang,uint qian,uint bai,uint shi,uint ge); void delay(uint z); void init(); void Main() { init();//初始化子程序 while(1) { if(aa==20)   { aa=0; temp++; if(temp==99999)    { temp=0;    } wang=temp/10000; qian=(temp-wang*10000)/1000; bai=(temp-wang*10000-qian*1000)/100; shi=(temp-wang*10000-qian*1000-bai*100)/10; ge=temp%10;   } display(wang,qian, bai,shi,ge); } }   void delay(uint z) { uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); }   void display(uint wang,uint qian,uint bai,uint shi,uint ge) {         dula=1; P0=table[wang]; dula=0; P0=0xff; wela=1; P0=0xfe; wela=0; delay(1);   dula=1; P0=table[qian]; dula=0; P0=0xff; wela=1; P0=0xfd; wela=0; delay(1);           dula=1; P0=table[bai]; dula=0; P0=0xff; wela=1; P0=0xfb; wela=0; delay(1);   dula=1; P0=table[shi]; dula=0; P0=0xff; wela=1; P0=0xf7; wela=0; delay(1);   dula=1; P0=table[ge]; dula=0; P0=0xff; wela=1; P0=0xef; wela=0; delay(1); }   void init() { wela=0; dula=0; temp=0; TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; EA=1; ET0=1; TR0=1; }   void timer0() interrupt 1 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; aa++; } include<reg52.h> #define uint unsigned int #define uchar unsigned char uint temp,aa,wang,qian,bai,shi,ge; sbit dula=P2^6; sbit wela=P2^7; uchar code table[]={ 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; void display( uint wang,uint qian,uint bai,uint shi,uint ge); void delay(uint z); void init(); void Main() { init();//初始化子程序 while(1) { if(aa==20)   { aa=0; temp++; if(temp==99999)    { temp=0;    } wang=temp/10000; qian=(temp-wang*10000)/1000; bai=(temp-wang*10000-qian*1000)/100; shi=(temp-wang*10000-qian*1000-bai*100)/10; ge=temp%10;   } display(wang,qian, bai,shi,ge); } }   void delay(uint z) { uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); }   void display(uint wang,uint qian,uint bai,uint shi,uint ge) {         dula=1; P0=table[wang]; dula=0; P0=0xff; wela=1; P0=0xfe; wela=0; delay(1);   dula=1; P0=table[qian]; dula=0; P0=0xff; wela=1; P0=0xfd; wela=0; delay(1);           dula=1; P0=table[bai]; dula=0; P0=0xff; wela=1; P0=0xfb; wela=0; delay(1);   dula=1; P0=table[shi]; dula=0; P0=0xff; wela=1; P0=0xf7; wela=0; delay(1);   dula=1; P0=table[ge]; dula=0; P0=0xff; wela=1; P0=0xef; wela=0; delay(1); }   void init() { wela=0; dula=0; temp=0; TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; EA=1; ET0=1; TR0=1; }   void timer0() interrupt 1 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; aa++; } include<reg52.h> #define uint unsigned int #define uchar unsigned char uint temp,aa,wang,qian,bai,shi,ge; sbit dula=P2^6; sbit wela=P2^7; uchar code table[]={ 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, 0x7f,0x6f,0x77,0x7c, 0x39,0x5e,0x79,0x71}; void display( uint wang,uint qian,uint bai,uint shi,uint ge); void delay(uint z); void init(); void Main() { init();//初始化子程序 while(1) { if(aa==20)   { aa=0; temp++; if(temp==99999)    { temp=0;    } wang=temp/10000; qian=(temp-wang*10000)/1000; bai=(temp-wang*10000-qian*1000)/100; shi=(temp-wang*10000-qian*1000-bai*100)/10; ge=temp%10;   } display(wang,qian, bai,shi,ge); } }   void delay(uint z) { uint x,y; for(x=z;x>0;x--) for(y=110;y>0;y--); }   void display(uint wang,uint qian,uint bai,uint shi,uint ge) {         dula=1; P0=table[wang]; dula=0; P0=0xff; wela=1; P0=0xfe; wela=0; delay(1);   dula=1; P0=table[qian]; dula=0; P0=0xff; wela=1; P0=0xfd; wela=0; delay(1);           dula=1; P0=table[bai]; dula=0; P0=0xff; wela=1; P0=0xfb; wela=0; delay(1);   dula=1; P0=table[shi]; dula=0; P0=0xff; wela=1; P0=0xf7; wela=0; delay(1);   dula=1; P0=table[ge]; dula=0; P0=0xff; wela=1; P0=0xef; wela=0; delay(1); }   void init() { wela=0; dula=0; temp=0; TMOD=0x01; TH0=(65536-50000)/256; TL0=(65536-50000)%256; EA=1; ET0=1; TR0=1; }   void timer0() interrupt 1 { TH0=(65536-50000)/256; TL0=(65536-50000)%256; aa++; }

    标签: 矩阵式键盘

    上传时间: 2021-12-18

    上传用户:2590813506

  • PW2330-2.0.pdf规格书下载

    PW2330 develops a high efficiency synchronous step down DC-DC converter capable of delivering3A output current. PW2330 operates over a wide input voltage range from 4.5V to 30V andintegrates Main switch and synchronous switch with very low RDS(ON) to minimize the conductionloss. PW2330 adopts the proprietary instant PWM architecture to achieve fast transient responsesfor high step down applications and high efficiency at light loads. In addition, it operates atpseudo-constant frequency of 500kHz under continuous conduction mode to minimize the size ofinductor and capacitor

    标签: pw2330

    上传时间: 2022-02-11

    上传用户:

  • PW2205-2.0.pdf规格书下载

    PW2205 develops a high efficiency synchronous step-down DC-DC converter capable of delivering5A output current. PW2205 operates over a wide input voltage range from 4.5V to 30V andintegrates Main switch and synchronous switch with very low RDS(ON) to minimize the conductionloss.PW2205 adopts the instant PWM architecture to achieve fast transient responses for high step downapplications and high efficiency at light loads. In addition, it operates at pseudo-constant frequencyof 500kHz under continuous conduction mode to minimize the size of inductor and capacitor

    标签: pw2205

    上传时间: 2022-02-11

    上传用户:

  • PW2163-2.0.pdf规格书下载

    The PW2163 is a high efficiency 500 kHz synchronous step-down DC-DC converter capable ofdelivering 3A current. The PW2163 operates over a wide input voltage range from 4.5V to 18V andintegrates Main switch and synchronous switch with very low RDS(ON) to minimize the conductionloss. Low output voltage ripple and small external inductor and capacitor sizes are achieved with 500kHz switching frequency. It adopts the instant PWM architecture to achieve fast transient responsesfor high step down applications

    标签: pw2163

    上传时间: 2022-02-11

    上传用户:

  • Agilent 34401A Service Guide.pdf

    Agilent 34401A Service Guide.pdfIEC Measurement Category II includes electrical devices connected to Mains at an outlet on a branch circuit. Such devices include most small appliances, test equipment, and other devices that plug into a branch outlet or socket. The 34401A may be used to make measurements with the HI and LO inputs connected to Mains in such devices, or to the branch outlet itself (up to 300 VAC). However, the 34401A may not be used with its HI and LO inputs connected to Mains in permanently installed electrical devices such as the Main circuit-breaker panel, sub-panel disconnect boxes, or permanently wired motors. Such devices and circuits are subject to overvoltages that may exceed the protection limits of the 34401A. Note: Voltages above 300 VAC may be measured only in circuits that are isolated from Mains. However, transient overvoltages are also present on circuits that are isolated from Mains. The Agilent 34401A are designed to safely withstand occasional transient overvoltages up to 2500 Vpk. Do not use this equipment to measure circuits where transient overvoltages could exceed this level. Additional Notices Waste Electrical and Electronic Equipment (WEEE) Directive 2002/96/EC This product complies with the WEEE Directive (2002/96/EC) marking requirement. The affixed product label (see below) indicates that you must not discard this electrical/electronic product in domestic household waste. Product Category: With reference to the equipment types in the WEEE directive Annex 1, this product is classified as a "Monitoring and Control instrumentation" product. Do not dispose in domestic household waste. To return unwanted products, contact your local Agilent office, or see www.agilent.com/environment/product for more information. Agilent 34138A Test Lead Set The Agilent 34401A is compatible with the Agilent 34138A Test Lead Set described below. Test Lead Ratings Test Leads - 1000V, 15A Fine Tip Probe Attachments - 300V, 3A Mini Grabber Attachment - 300V, 3A SMT Grabber Attachments - 300V, 3A Operation The Fine Tip, Mini Grabber, and SMT Grabber attachments plug onto the probe end of the Test Leads. Maintenance If any portion of the Test Lead Set is worn or damaged, do not use. Replace with a new Agilent 3413

    标签: agilent

    上传时间: 2022-02-20

    上传用户: