选择
D
B
A
A
发送TCP意思应该是已经建立了连接,会超时重传。在未建立连接的时候,会放弃该链接
C
A
80端口是http
A
交换机攻击主要有五种:VLAN跳跃攻击 生成树攻击 MAC表洪水攻击 ARP攻击 VTP攻击
B
A
2^(32-26)+2^(32-27)+2^(32-27)=128 减去网段号和广播号为126
B
编程
斐波那契凤尾
斐波那契凤尾__牛客网
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;int main()
{vector<long long>dp(100000,0);dp[0]=1;dp[1]=2;int border=-1;//大于1000000的边界nfor(int i=2;i<100000;i++){long long tmp=dp[i-1]+dp[i-2];if(tmp>=1000000 && border==-1){border=i+1;//表示第border之后的值超过了100 0000}dp[i]=tmp%1000000;}int n;while(cin>>n){long long res=dp[n-1];if(n<border)printf("%d\n",res);//该输出1的时候 不能补位补成 000 001else{printf("%06d\n",res);}}return 0;
}
淘宝收益
淘宝网店__牛客网
// write your code here cpp#include<iostream>using namespace std;//非闰年为标准
int totalday[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
//非闰年 - 每个月的总收益
int totalMoney[12] = {62, 28, 31, 60, 31, 60, 31, 62, 60, 62, 30, 62};//判断该月份是否为素数
bool Judge_IsPriNum(int month){if(month == 2 || month == 3 || month == 5 || month == 7 ||month == 11){return true;}return false;
}//判断该年份是否为闰年
bool Judge_IsLeaYear(int year){if( (year % 4 == 0 && year % 100 != 0) || year % 400 == 0){return true;}return false;
}//计算相差day2 - day1天数的收益
int Caclue_Day(int day1, int day2, int month){//1 - 31, 是31天 31 - 1 = 30 -- 得加1int sum = day2 - day1 + 1;if(!Judge_IsPriNum(month)){//非素数一天赚2块sum += sum;}return sum;
}//计算相差month2 - month1 整月数的收益
int Caclue_Month(int month1, int month2, int year){int sum = 0;for(int i = month1; i <= month2; ++i){//下标-1sum += totalMoney[i - 1]; //2月 - 闰年 - 多加1块if(i == 2 && Judge_IsLeaYear(year)){sum += 1;}}return sum;
}//计算相差year2 - year1 整年数的收益
int Caclue_Year(int year1, int year2){int sum = 0;for(int i = year1; i <= year2; ++i){sum += Caclue_Month(1, 12, i); }return sum;
}int main(){//定义接受的年月日int year1, month1, day1;int year2, month2, day2;while(cin >> year1 >> month1 >> day1 >> year2 >> month2 >> day2){//由于是整数 还是 是空格分隔, 采用cin就可以int total_num = 0;if(year1 == year2){//同一年份if(month1 == month2){//同一月份 total_num = Caclue_Day(day1, day2, month1);}else{//不同月份//1、先计算两者相差整月份的收益total_num += Caclue_Month(month1, month2, year1);//2、month1首月不足一月的天数收益total_num += Caclue_Day(day1, totalday[month1 - 1], month1);//3、month2尾月不足一月的天数收益total_num += Caclue_Day(1, day2, month2);} }else{//不同年份//1、先计算两者相差整年份的收益total_num += Caclue_Year(year1 + 1, year2 - 1);//2、year1年份不足一年整月份的收益total_num += Caclue_Month(month1 + 1, 12, year1);//3、year2年份不足一年整月份的收益total_num += Caclue_Month(1, month2 - 1, year2);//4、year1中首月不足一月的收益total_num += Caclue_Day(day1, totalday[month1 - 1], month1);//5、year2中尾月不足一月的收益total_num += Caclue_Day(1, day2, month2); }//输出cout << total_num << endl;}
}