关于杂七杂八

int main()
{
    float a = 8.18f;     //注意float输入单精度浮点,小数点后6位,需要在小数后面加个f 
    double b = 2.26;      //虽然double双精度,但是c++默认输入小数点后五位(C++默认小数都是double形式) 
    cout<<"his birthday is "<<a<<"\nmine is"<<b<<endl;  //利用\n换行 
    float f1 = 3e2;     //科学计数法 表示3*10^2 
    cout<<f1<<endl;
    float f2 = 3e-2;     //科学计数法 表示3*0.1^2 
    cout<<f2<<endl;
    system("pause");
    return 0;
}


/*int main()
{
    char ch ='a';
    cout<<ch<<endl;     //打印字符串char ch,不可以双引号,不可以多个 
    cout<<(int)ch<<endl;     //显示97(ASCII),(int)代表把字符串变成整形 
    system("pause");
    return 0;
}*/
/*int main()
{
    char ch ='a';
    int c = 0;     //整形赋给数字符 
    c = ch;
    cout<<c<<endl;
    return 0;
}*/
/*int main()
{
    int a = 100;     //字符赋给字整形 
    char ch;
    ch = a;
    cout<<ch<<endl;
    return 0;
}*/
/*int main()
{
    int i,j;
    i = 'a';
    j = 'b';
    cout<<i<<j<<endl;
    return 0;
}*/
/*int main()
{
    cout<<"hello\n";     //换行符号\n 
    cout<<"aaa\thello"<<endl;     //制表符\t ,生成8个位置,包括前面的aaa
    cout<<"\\"<<endl;     //想要输入反斜杠,必须打两下 
    system("pause");
    return 0;
}*/
/*int main()
{
    char str = "hello cz";     //char+字符串 ,注意必须大括号,双引号 
    cout<<str<<endl; 
    
    system("pause");
    return 0;
}*/
/*#include<string>                  //要用string必须先输入头文件 
int main()
{
    string str = "hello cz";     //string+字符串 
    cout<<str<<endl;
    system("pause");
    return 0;
}*/
/*int main()
{
    bool flag = true;     //bool是用来输出真或(1)假(0) 
    cout<<flag<<endl;     //赋值true false 
    flag=false;
    cout<<flag<<endl;
    system("pause");
    return 0;
}*/
/*int main()
{
    int a = 0;
    cout<<"put a num to a"<<endl;     //数据的输入 
    cin>>a;
    cout<<"now a = "<<a<<endl;
    system("pause");
    return 0;
}*/
/*int main()
{
    int a1 = 10;
    int b1 = ++a1*10;     //前置递增,先把a1增加,再运算 
    
    cout<<a1<<endl;
    cout<<b1<<endl;
    
    int a2 = 10;
    int b2 = a2++*10;     //后置递增,先按原始的计算,再把a2加一 
    cout<<a2<<endl;
    cout<<b2<<endl;
    system("pause");
    return 0; 
}*/
/*int main()
{
    int a = 020;     //前面加0是八进制 
    int b = 0X20;     //前面加0X是十六进制 
    cout<<a<<endl;
    cout<<b<<endl;
    system("pause");
    return 0;
}*/
/* 

/*int main()
{
    float a = 8.18f;     //注意float输入单精度浮点,小数点后6位,需要在小数后面加个f 
    double b = 2.26;      //虽然double双精度,但是c++默认输入小数点后五位 
    cout<<"his birthday is "<<a<<"\nmine is"<<b<<endl;  //利用\n换行 
    float f1 = 3e2;     //科学计数法 表示3*10^2 
    cout<<f1<<endl;
    float f2 = 3e-2;     //科学计数法 表示3*0.1^2 
    cout<<f2<<endl;
    system("pause");
    return 0;
}*/
/*int main()
{
    char ch ='a';
    cout<<ch<<endl;     //打印字符串char ch,不可以双引号,不可以多个 
    cout<<(int)ch<<endl;     //显示97(ASCII),(int)代表把字符串变成整形 
    system("pause");
    return 0;
}*/
/*int main()
{
    char ch ='a';
    int c = 0;     //整形赋给数字符 
    c = ch;
    cout<<c<<endl;
    return 0;
}*/
/*int main()
{
    int a = 100;     //字符赋给字整形 
    char ch;
    ch = a;
    cout<<ch<<endl;
    return 0;
}*/
/*int main()
{
    int i,j;
    i = 'a';
    j = 'b';
    cout<<i<<j<<endl;
    return 0;
}*/
/*int main()
{
    cout<<"hello\n";     //换行符号\n 
    cout<<"aaa\thello"<<endl;     //制表符\t ,生成8个位置,包括前面的aaa
    cout<<"\\"<<endl;     //想要输入反斜杠,必须打两下 
    system("pause");
    return 0;
}*/
/*int main()
{
    char str[] = "hello cz";     //char+字符串 ,注意必须大括号,双引号 
    cout<<str<<endl; 
    
    system("pause");
    return 0;
}*/
/*#include<string>                  //要用string必须先输入头文件 
int main()
{
    string str = "hello cz";     //string+字符串 
    cout<<str<<endl;
    system("pause");
    return 0;
}*/
/*int main()
{
    bool flag = true;     //bool是用来输出真或(1)假(0) 
    cout<<flag<<endl;     //赋值true false 
    flag=false;
    cout<<flag<<endl;
    system("pause");
    return 0;
}*/
/*int main()
{
    int a = 0;
    cout<<"put a num to a"<<endl;     //数据的输入 
    cin>>a;
    cout<<"now a = "<<a<<endl;
    system("pause");
    return 0;
}*/
/*int main()
{
    int a1 = 10;
    int b1 = ++a1*10;     //前置递增,先把a1增加,再运算 
    
    cout<<a1<<endl;
    cout<<b1<<endl;
    
    int a2 = 10;
    int b2 = a2++*10;     //后置递增,先按原始的计算,再把a2加一 
    cout<<a2<<endl;
    cout<<b2<<endl;
    system("pause");
    return 0; 
}*/
/*int main()
{
    int a = 020;     //前面加0是八进制 
    int b = 0X20;     //前面加0X是十六进制 
    cout<<a<<endl;
    cout<<b<<endl;
    system("pause");
    return 0;
}*/
/*

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值