本文共 2297 字,大约阅读时间需要 7 分钟。
#includevoid ShowRevertNum(int iNum){ while(iNum>10){ printf("%d",iNum%10);iNum=iNum/10;}}int main(void){ int iNum;printf("please input a number: ");scanf("%d",&iNum);printf("After revert:");ShowRevertNum(iNum);}
{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "build", "type": "shell", "command": "g++", "args": [ "-g", "${file}", "-std=c++11", "-o", "${fileBasenameNoExtension}.out" ], "problemMatcher": [ "$gcc" ] } ]}
launch.json
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/${fileBasenameNoExtension}.out", "args": [], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", "preLaunchTask": "build", "setupCommands": [ { "description": "Enable pretty-printing for gdb", "text": "-enable-pretty-printing", "ignoreFailures": true } ] } ]}
#include "stm32f10x.h"GPIO_InitTypeDef GPIO_InitStructure;void delay_ms(uint32_t ms){ uint32_t i_cnt,j_cnt; for(i_cnt=0;i_cnt<3000;i_cnt++); for(j_cnt=0;j_cntBSRR=0xff; while (1) { for(i=0;i<8;i++) { delay_ms(99000); GPIOC->BRR=(1< BSRR=(1< BRR=0x000000ff; delay_ms(99000); GPIOC->BSRR=0x000000ff; } }}
转载地址:http://divqf.baihongyu.com/