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

include

include是一个计算机专业术语,一指C/C++中包含头文件命令,用于将指定头文件嵌入源文件中。二指include指令,在JSP中包含一个静态的文件,同时解析这个文件中的JSP语句。三指PHP语句。
  • 数组子系统

    #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

  • stdafx.h

    --stdafx.h中没有函数库,只是定义了一些环境参数,使得编译出来的程序能在32位的操作系统环境下运行。 windows和mfc的include文件都非常大,即使有一个快速的处理程序,编译程序也要花费相当长的时间来完成工作。由于每个.cpp文件都包含相同的include文件,为每个.cpp文件都重复处理这些文件就显得很傻了。 为避免这种浪费,appwizard和visualc++编译程序一起进行工作,如下所示: --appwizard建立了文件stdafx.h,该文件包含了所有当前工程文件需要的mfcinclude文件。且这一文件可以随被选择的选项而变化。 --appwizard然后就建立stdafx.cpp。这个文件通常都是一样的。 --然后appwizard就建立起工程文件,这样第一个被编译的文件就是stdafx.cpp。 --当visualc++编译stdafx.cpp文件时,它将结果保存在一个名为stdafx.pch的文件里。(扩展名pch表示预编译头文件。) --当visualc++编译随后的每个.cpp文件时,它阅读并使用它刚生成的.pch文件。visualc++不再分析windowsinclude文件,除非你又编辑了stdafx.cpp或stdafx.h。 在这个过程中你必须遵守以下规则: --你编写的任何.cpp文件都必须首先包含stdafx.h。 --如果你有工程文件里的大多数.cpp文件需要.h文件,顺便将它们加在stdafx.h(后部)上,然后预编译stdafx.cpp。 --由于.pch文件具有大量的符号信息,它是你的工程文件里最大的文件。 如果你的磁盘空间有限,你就希望能将这个你从没使用过的工程文件中的.pch文件删除。执行程序时并不需要它们,且随着工程文件的重新建立,它们也自动地重新建立。

    标签: stdafx

    上传时间: 2021-05-19

    上传用户:1155

  • 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

  • 矩阵式键盘

    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

  • PW4055_2.0.pdf规格书下载

    The PW4055 is a complete constant-current /constant-voltage linear charger for single cell lithiumion batteries.Its ThinSOT package and low external component count make the PW4055 ideallysuited for portable applications.Furthermore, the PW4055 is specifically designed to work within USBpower specifications.The PW4055 No external sense resistor is needed, and no blocking diode is required due to theinternal MOSFET architecture.Thermal feedback regulates the charge current to limit the dietemperature during high power operation or high ambient temperature. The charge voltage is fixedat 4.2V, and the charge current can be programmed externally with a single resistor. The PW4055automatically terminates the charge cycle when the charge current drops to 1/10th the programmedvalue after the final float voltage is reached. When the input supply (wall adapter or USB supply) isremoved, the PW4055 automatically enters a low current state, dropping the battery drain currentto less than 2µA. The PW4055 can be put into shutdown mode, reducing the supply current to 25µA.The BAT pin has a 7KV ESD(HBM) capability. Other features include charge current monitor, undervoltage lockout, automatic recharge and a status pin to indicate charge termination and the presenceof an input voltage

    标签: pw4055

    上传时间: 2022-02-11

    上传用户:jason_vip1

  • 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

    上传用户:

  • Ansoft0MaxwellV12电机瞬态分析教程

    This Getting Started Guide is written for Maxwell beginners and experienced users who would like to quickly re familiarize themselves with the capabilities of MaxwelL.This guide leads you step-by-step through solving and analyzing the results of a rotational actuator magnetostatic problem with motion By following the steps in this guide, you will learn how to perform the following tasks Modify a models design parameters y Assign variables to a model's design parameters.Specify solution settings for a design Validate a designs setupRun a maxwell simulation v Plot the magnetic flux density vecto v include motion in the simulation本《入门指南》是为希望快速重新熟悉MaxwelL功能的Maxwell初学者和有经验的用户编写的。本指南将引导您逐步解决和分析旋转致动器静运动问题的结果。按照本指南中的步骤,您将学习如何执行以下任务。修改模型设计参数y将变量分配给模型的设计参数。指定设计的解决方案设置验证设计设置运行maxwell模拟v绘制磁通密度vecto v在模拟中包含运动

    标签: ansoft maxwell

    上传时间: 2022-03-10

    上传用户:

  • 电子书- 十天学会单片机实例100.pdf

    电子书-十天学会单片机实例100.pdf//实例 4:用单片机控制一个灯闪烁:认识单片机的工作频率 #include<reg51.h> //包含单片机寄存器的头文件 /**************************************** 函数功能:延时一段时间 *****************************************/ void delay(void) //两个 void 意思分别为无需返回值,没有参数传递 { unsigned int i; //定义无符号整数,最大取值范围 65535 for(i=0;i<20000;i++) //做 20000 次空循环 ; //什么也不做,等待一个机器周期 } /******************************************************* 函数功能:主函数 (C 语言规定必须有也只能有 1 个主函数) ********************************************************/ void main(void) { while(1) //无限循环 { P1=0xfe; //P1=1111 1110B, P1.0 输出低电平 delay(); //延时一段时间 P1=0xff; //P1=1111 1111B, P1.0 输出高电平 www.91

    标签: 单片机

    上传时间: 2022-03-19

    上传用户:kingwide

  • arduino电子秤程序

    HX711_1Kg#include "HX711.h"float Weight = 0;void setup(){ Init_Hx711(); //初始化HX711模块连接的IO设置 Serial.begin(9600); Serial.print("Welcome to use!\n"); delay(3000); Get_Maopi(); //获取毛皮}void loop(){ Weight = Get_Weight(); //计算放在传感器上的重物重量 Serial.print(float(Weight/1000),3); //串口显示重量 Serial.print(" kg\n"); //显示单位 Serial.print("\n"); //显示单位 delay(1000); //延时1s}

    标签: arduino 电子秤

    上传时间: 2022-03-20

    上传用户: