#include<stdio.h>
int main() {
int a;
int b;
printf("请输入两个整数:");
scanf("%d %d",&a,&b);
printf("%d+%d=%d\n",a,b,a+b);
return 0;
}
阅读全部
|
数数
贴于 2023年2月7日 17:50
hide
bbsi
#include<stdio.h>
int main() {
int a;
int b;
printf("请输入两个整数:");
scanf("%d %d",&a,&b);
printf("%d+%d=%d\n",a,b,a+b);
return 0;
}
阅读全部
|
数数
贴于 2023年2月7日 17:50
hide
bbsi
print("我在中国学Python\n")
# 练习一下循环的使用
for i in range(1, 21):
print(f"我爱编程中国 {i} 次")
print(000)
阅读全部
|
gxlawq
贴于 2023年1月29日 15:54
hide
bbsi
import time
scale = 20
print("------执行开始------")
for i in range(scale+1):
a, b = '**' * i,'..' * (scale - i)
c = (i/scale)*100
print("%{:^3.0f}[{}->{}]" .format (c, a, b))
time.sleep(0.1)
print("------执行结束------")
阅读全部
|
东海ECS
贴于 2023年1月27日 12:45
hide
bbsi
经过视频学习后练习写了一段程序,软件仿真时发现有两条指令不能选中(对应序号左侧不能变灰)。找不到问题原因,请指导。(如程序中的“启动总线”和“发送器件地址”相邻的两项)。
void WriteDAC(uchar DAT)
{
uchar chi;
iic_start(); //启动总线
iic_SendByte(PCF8591_WRITE); //发送器件地址
if(Read_ACK())
ACKFiag=1; //NOACK
else
ACKFiag=0; //ACK
......................
阅读全部
|
h1357951
贴于 2023年1月21日 11:39
hide
bbsi
void Widget::AnalyzeData()
{//读取数据
QByteArray recvData = myserial->readAll();//定义mytemp为串口读取的所有数据
recvData.resize(1024);
qDebug()<<"recvData:"<<recvData;
if(!recvData.isEmpty())
{//从dht22采集来的数据进行转换 由bytearray 转成int
QString StrI1=recvData.toHex().mid(8,2);
QString StrI2=recvData.toHex().mid(24,2);
......................
阅读全部
|
niefeng0429
贴于 2023年1月19日 11:18
hide
bbsi
/*------------------------------------------------
写入DA转换数值
输入参数:dat 表示需要转换的DA数值,范围是0-255
------------------------------------------------*/
void WriteDAC(uchar DAT)
{
iic_start(); //启动总线,(序号160)
iic_SendByte(PCF8591_WRITE); //发送器件地址 (序号161)
if(Read_ACK())
ACKFiag=1; //NOACK
else
......................
阅读全部
|
h1357951
贴于 2023年1月16日 17:24
hide
bbsi
Option Explicit
Dim JScript, CString, File, Control, System, NetWork '定义线程级变量 '每个线程不同
Dim Window, VBSlibrary
Dim HttpProgress
Const IsDebug = 0
Const Version = "0.0.0.7"
Sub Main()
If Globals("App").PrevInstance Then
Dim ws, WMI, Process
Set ws = CreateObject("wscript.shell")
ws.SendKeys "{HOME}"
Set WMI = GetObject("WinMgmts:")
......................
阅读全部
|
王宇577
贴于 2023年1月15日 02:49
hide
bbsi
Option Explicit
Const C_WorkProgress = 4
Class UI_Class
Public Form, Tip, config, AppName, Starting, Angel
Private Menu, hMenu1(1), hMenu2(0), timing
Private Tooptip
Private DisablePowerSave
Private Sub Create()
Dim i, v, s, j, arr
Set Menu = Control.Menu()
Set Form = Api.NewForm()
Set Tooptip = Control.Tooptip()
......................
阅读全部
|
王宇577
贴于 2023年1月15日 02:42
hide
bbsi
Option Explicit
Const C_GameWith = 1024
Const C_GameHeight = 768
Const C_GameSmallWith = 320
Const C_GameSmallHeight = 240
'黑带 16 20
Dim GamehWnd, dm, AppName, config, bgkms, KMData
config = ".\Angel.ini"
AppName = "Angel_BP"
Function CmpMutlColor(Args, Sleep)
Dim i
For i = 0 To UBound(Args)
......................
阅读全部
|
王宇577
贴于 2023年1月15日 02:35
hide
bbsi