由于动态规划的LCS问题,需要从第一个字符开始读取比较方便。所以用gets_s();第一个参数是起始位置,第二个参数是字读取字符的长度。

#include<bits/stdc++.h>
#include<cstdio>
using namespace std;
const int N = 100;
char A[N], B[N];
int dp[N][N];
int main()
{
int n;
gets_s(A + 1,105);
gets_s(B + 1, 105);
int lenA = strlen(A + 1);
int lenB = strlen(B + 1);
}

  

VS2017gets的使用的更多相关文章

随机推荐

  1. C语言指针赋值前的指向问题

    以下代码运行会得到什么结果? #include<stdio.h> int main() { int *k;//定义一个指针变量 *k=100;#给指针变量所指的内存赋值 printf(&q ...

  2. WordOperate

    using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using S ...

  3. sql里的ROW_NUMBER() OVER是啥意思?

    是一个分析函数,生成一个排序列select row_number(XX) over(partition by XXX order by XX [desc/asc]) frou table;partit ...

  4. php之sphinx

    1.修改sphinx配置文件? source 数据源名称 { type = mysql ######数据源类型 sql_host = #######数据库主机地址(如果是外网,请确保防火墙允许链接) ...

  5. 线上bug处理

    http:response X-Frame-Options是什么? x-frame-options是一个HTTP响应头,用来告诉浏览器这个网页是否可以放在iframe内. x-frame-option ...

  6. dbclient python ---influxdb -install -relay--http write--read.[create db]

    1s=1000ms 1ms=1000 microseconds 1microsecond=1000 nanoseconds+01:00 from influxdb import InfluxDBCli ...

  7. JDBC---Mysql(2)

    SQL注入攻击: 用户可以提交一段数据库查询代码,根据程序返回的结果,获得某些他想知道的数据,这就是所谓的SQL注入攻击, 例如:判断username='a' or 'a'='a';  true从而为 ...

  8. 斜率优化&单调性优化的相似性

    写了一道单调性优化发现 跟斜率优化很像,而且这道题目感觉质量非常的好. 其实斜率优化是基于单调性优化的,但是面对这道题 我竟然连单调性优化都不太会,尽管这个模型非常不好理解. 对于每道题 我都会打一个 ...

  9. LeetCode 690 Employee Importance 解题报告

    题目要求 You are given a data structure of employee information, which includes the employee's unique id ...

  10. LeetCode 905 Sort Array By Parity 解题报告

    题目要求 Given an array A of non-negative integers, return an array consisting of all the even elements ...