切换中英文:Shift
切换大小写:CapsLock
Ctrl+滚轮:缩放
Ctrl+C:复制
Ctrl+V:粘贴
使用英文输入法输入
每行以分号结束
#include<iostream>//头文件
using namespace std;//调用命名空间
int main(){//主函数
return 0;//返回值
}
输出:cout<<
换行:“\n”或endl
//单行注释
include 包含
input 输入
output 输出
stream 流
use 使用
space 空间;太空;空格
main 主要的
return 返回
world 世界
设置速度:
Drivetrain.setDriveVelocity(50,percent);//(60,rpm)
设置方向:
Drivetrain.drive(forward)//(reverse)
设置时间
wait(3,seconds) ; //(10,msec)
停止运动:
Drivetrain.stop();
brain 主控,大脑
battery 电池
charge 充电,控告
motor 电机,发动机
drive 驾驶
train 火车;训练
drivetrain 传动系
set 设置
velocity 速度
percent 百分比
rpm 每分钟转速
(revolution per minute)
forward 向前
reverse 反转;相反的
wait 等待
second 秒;第二
millimeter 毫秒
1s=1000ms
stop 停
数据类型
类型 关键字 占字节数 例
布尔型 bool 1 true/fase
字符型 char 1 'c'
整型 int 4 15
浮点型 float 4 2.71828
数据类型长度函数
sizeof()
ASCII编码
A-Z:65-90
a-z:97-122
byte 字节
double 双精度浮点数
size 大小;尺寸
character 家母,性格
intger 整数
Ctrl+A: 全选
Ctrl+A: 撤销
等待直到:
waitUntil();
碰撞开关按压:
BumperN.setVelocity(100.percent);
设置电机速度:
MotorN.setVelocity(100.percent);
设置电机方向:
MotorN.spin(forward);
电机停止:
MotorN.stop();
判断a与b是否相等:a==b
while循环
while(条件){
成立执行的语句
]
library 库,图书馆
begin 开始
allon 允许
code 代码
until 直到
bump 碰撞
pump 水泵,注入
press 按压
spin 旋转
#include<iostream>
using namespace std;
int main(){
int a=2.5;
float b=2.5;
cout<<a<<endl;
cout<<b<<endl;
int c=9999999999;
cout<<c<<" "<<sizeof(c)<<endl;
long long int d=9999999999;
cout<<d<<" "<<sizeof(d)<<endl;
char m='A';
int n='z';
cout<<m<<endl;
cout<<n<<endl;
bool x=-5;
cout<<x;
return 0;
}
#include<iostream>
using namespace std;
int main(){
bool a=false;
char b='A';
int c=100;
float d=3.14;
cout<<"数据类型"<<"\t"<<"关键字"<<"\t\t"<<"占字节数"<<"\t"<<"例"<<endl;
cout<<"布尔型"<<"\t\t""bool"<<"\t\t"<<sizeof(a)<<"\t\t"<<a<<endl;
cout<<"字符型"<<"\t\t""char"<<"\t\t"<<sizeof(b)<<"\t\t"<<b<<endl;
cout<<"整型"<<"\t\t""int"<<"\t\t"<<sizeof(c)<<"\t\t"<<c<<endl;
cout<<"浮点型"<<"\t\t""float"<<"\t\t"<<sizeof(d)<<"\t\t"<<d<<endl;
1848

被折叠的 条评论
为什么被折叠?



