TCL图像笔试

/*
* @Author: lenovouser
* @Date:   2020-09-06 15:59:07
* @Last Modified by:   lenovouser

* @Last Modified time: 2020-09-06 16:00:25

*/

#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include<ctime>
#include<vector>
#include <cstring>
using namespace std;
class A
{
public:
    int a=0;
    A(){a=5;cout<<"A";}

};
class B:public A
{
public:
    B(){a++;cout<<"B";}

};

int main(int argc, char const *argv[])
{
    /* code */
    B b;
    cout<<b.a;

    // char a[]={'1','0'};
    // cout<<sizeof(a)<<strlen(a);
    return 0;
}

在这里插入图片描述
子类构造函数会调用父类构造函数。

 const int i=100;
    int *j=const_cast<int*>(&i);
    *j=200;
    cout<<i<<endl<<*j<<endl<<&i<<endl<<j;

在这里插入图片描述

  1. 以下三条输出语句分别输出什么?
    char str1[] = “abc”;
    char str2[] = “abc”;
    const char str3[] = “abc”;
    const char str4[] = “abc”;
    const char* str5 = “abc”;
    const char* str6 = “abc”;
    cout << boolalpha << ( str1str2 ) << endl; // 输出什么?false
    cout << boolalpha << ( str3
    str4 ) << endl; // 输出什么?false
    cout << boolalpha << ( str5==str6 ) << endl; // 输出什么?true
    char * const p; //常指针或者指针常量,p的值不可以修改
    char const * p;//指向常量的指针或常量指针,指向的常量值不可以改
    const char *p; //同char const *p
    str1,str2,str3,str4是数组变量,它们有各自的内存空间;
    而str5,str6是指针,它们指向相同的常量区域
    #include
    using namespace std;
    int main()
    {
    bool b=true;
    cout <<“b=”<< b << endl;
    b =false;
    cout <<“b=”<< b << endl;
    cout <<“b=”<< boolalpha << b << endl;
    cout << b << endl;
    bool a =true;
    cout <<"a = "<< a << endl;
    }
    输出结果:
    b=1
    b=0
    b=false
    0
    a =1
/*
* @Author: lenovouser
* @Date:   2020-09-06 15:59:07
* @Last Modified by:   lenovouser

* @Last Modified time: 2020-09-06 16:00:25

*/

#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include<ctime>
#include<vector>
#include <cstring>
using namespace std;
class A
{
public:
    int a=0;
    A(){a=5;cout<<"A";}

};
class B:public A
{
public:
    B(){a++;cout<<"B";}

};

int main(int argc, char const *argv[])
{
    /* code */
    // B b;
    // cout<<b.a;
    char str1[] = "abc";
char str2[] = "abc";
const char str3[] = "abc";
const char str4[] = "abc";
const char* str5 = "abc";
const char* str6 = "abc";
char a[]={'a','b','c'};
// cout << boolalpha << ( str1==str2 ) << endl; // 输出什么?fals
cout<<sizeof(str1)<<sizeof(a)<<endl<<strlen(str1)<<strlen(a)<<endl;
cout<<sizeof(str5)<<strlen(str5);
//
    // char a[]={'1','0'};
    // cout<<sizeof(a)<<strlen(a);
    return 0;
}

在这里插入图片描述
strlen(a)居然是6.

/*
* @Author: lenovouser
* @Date:   2020-09-06 15:59:07
* @Last Modified by:   lenovouser

* @Last Modified time: 2020-09-06 16:00:25

*/

#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include<ctime>
#include<vector>
#include <cstring>
using namespace std;
class A
{
public:
    int a=0;
    A(){a=5;cout<<"A";}

};
class B:public A
{
public:
    B(){a++;cout<<"B";}

};
struct T
{
    uint8_t a;
    uint16_t b;
    uint32_t c;

};

int main(int argc, char const *argv[])
{
    /* code */
    T t;
    cout<<sizeof(t.a)<<sizeof(t.b)<<sizeof(t.c)<<sizeof(t);
    // B b;
    // cout<<b.a;

}

在这里插入图片描述
大光圈,浅景深。长焦距浅景深。
f/n,n越大,光圈越小。
n=焦距/光圈
定焦是焦距固定,可以对焦。
色温谱,从红到蓝。
多线程。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值