Dev-Cpp使用&快捷键

it2024-03-29  55

之前搞过蓝桥杯,就从官网下载了Dev-cpp软件~ http://dasai.lanqiao.cn/pages/dasai/news_detail_w.html?id=1819

解压后,点击File – New – Project,直接F9编译F10运行:

#include <stdio.h> int main(int arg ,char *argv[]) { int a = 0; scanf( "%d" , &a ); printf( "a的值为 %d" , a ); return 0; }

C++的输入输出

#include <iostream> using namespace std; int main() { int a = 0; cin >> a; cout << "a的值为" << a <<endl; return 0; }

Java的输入输出

import java.util.Scanner; class ScannerTest{ public static void main(String[] args){ //实例化对象 Scanner scan = new Scanner(System.in); //调用相关方法 System.out.println("请输入a的值:"); Int a = scan.nextInt(); System.out.println(a); } }

编译运行

编译 F9 运行 F10 编译运行 F11

调试

生成断点 ctrl+F5 开始调试 F8 执行当前行并跳到下一行 F7 跳到下一断点 crtl +F7 跳到光标位置 shift+F4 查看变量的值 F4

其他

设置注释 Ctrl+/ (取消注释Ctrl+/) 复制行 Ctrl+E 删除行 Ctrl+D 整体左移一个tab位置 shift+tab 整体右移一个tab位置 tab 整体代码缩进对齐 Ctrl+Shift+A

最新回复(0)