代码搜索结果
找到约 10,000 项符合
C++ 的代码
c++
#include
const double PI=3.1416; //声明常量(const变量)PI为3.1416
main()
{
//声明3个变量
double r,l,s;
//输入圆的半径
coutr;
//计算圆的周长
c++
#include
main()
{
//x,y 为操作数,c为运算符
int x,y,z;
char c1;
cin>>x>>c1>>y; //c1
//多路选择语句选择不同表达式计算语句
switch(c1) {
case '+':cout
c++
#include
const int MAX=5; //假定栈中最多保存5个数据
//定义名为stack的类,其具有栈功能
class stack {
//数据成员
float num[MAX]; //存放栈数据的数组
int top; //指示栈顶位置的变量
public:
//成员函数
c++
#include
//定义rect类
class rect {
int length;
int width;
int area;
public:
rect(int l=1,int w=1)
{
length=l;
width=w;
area=length*widt
c++
#include
//定义一个枚举类型
enum Color {Red,Yellow,Green,White};
//圆类Circle的定义
class Circle {
float radius;
public:
Circle(float r) {
radius=r;
cout
c++
#include
#include
#include
#include
using namespace std;
//如果字符串以'S'开头,则返回true
int MatchFirstChar( const string& str)
{
string s("S") ;
re
c++
#include
#include
#include
using namespace std;
//创建multimap的实例,整数(int)映射字符串(string)
typedef multimap INT2STRING;
//测试multimap容器
void main()
{
c++
#include
//定义一个含有static数据成员的类
class ex
{
static int num; //static数据成员
public:
ex() {num++;}
~ex() {num--;}
disp_count() {
cout
c++
#include
int extract_int()
{
char ch;
int n=0;
while(ch=cin.get())
if (ch>='0' && ch>n;
c++
#include
#include
#include
#include
#define ARRAY_SIZE 15
using namespace std;
//定义整型数的vector容器类
typedef vector IntVector ;
//显示数组
void pu