C++在线运行

版本:

编辑于 2023-09-06 23:43 累计访问:8385
点击了解高性能代码运行API
运行结果
代码简介
代码仓库
极速运行
终端运行
图形+终端

                        
用户最新保存的代码
查看更多

作者 跬步(1949)
编辑于:2023-09-06 23:43

#include <iostream> using namespace std;

int main() { cout << "Hello World!"; return 0; }

提示:本站严禁涉政、违法等无关技术的内容
发送
搭载国产梦丘操作系统,支持安装软件,在线编程可视化开发软件,无需配置开发环境

点击购买 梦丘固件
  # c语言第一个程序 include ``` stdio.h ``` int main() { printf("hello world!"); return 0; } 2865

  #include<iostream> using namespace std; class Base { public: virtual void fn() { cout <<"In Base Class\n";} }; class SubClass : public Base { public: virtual void fn(){ cout <<"In Sub Class\n"; } }; int main() { Base bc; Base *p; SubClass sc; p=&bc; p->fn(); p=&sc; p->fn(); } 5078

  #include <iostream> #include <chrono> #include <thread> int main() { std::cout << "延迟输出前的消息" << std::endl; // 设置延迟时间为3秒 std::chrono::seconds delay(3); // 让线程睡眠3秒 std::this_thread::sleep_for(delay); std::cout << "延迟输出后的消息" << std::endl; return 0; } 7982

  #include <iostream> using namespace std; int main() { cout << "Hello World!"; return 0; } 8386

  #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { double r; cin>>r; double v=3.14*r*r*r*4.0/3; cout<<fexed<<setprecision(2)<<v; return 0; } 3133

  #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { double r; cin>>r; double v=3.14*r*r*r*4.0/3; cout<<fexed<<setprecision(2)<<v; return 0; } 6767

  #include <stdio.h> #include <stdlib.h> int main(int argc,char *argv[]) { printf("%s\n",argv[0]);//读取可执行程序(包括路径) /*读取参数*/ int i = 1; while(i < argc) { printf("%s\n",argv[i]); i++; } return 0; } 9118

  #include<stdio.h> int main() { int week = 0; scanf("%d",&week); if(week >= 7){ printf("小了"); }else{ if(week <= 1) printf("大了"); } return 0; } 3964

  #include <iostream> using namespace std; int main() { int n=0,s=0; for(int ;s<=1000;s+=n) { n++; } cout <<n<<endl; //1 2 3 4 5 6 //1+2+3+4=10 /* while(s<=1000) { n++; s+=n;//s = s+n; } cout <<n<<endl; */ } 2991

  LESSON 1 #include<stdio.h> int main(){ printf("hello world"); return 0; } 2055

  #include <iostream> using namespace std; int main() { int day; cout<<"请回答一周有几天:"; cin>>day; cout<<"您的回答是一周有"<<day; return 0; if (day = 7) { cout<<"回答正确"<<endl; } } 1129

Hello World
Hello World
编写Hello World