- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
假设如果 A = 1 , B = 2 ----- Z = 26 ,现在 AA = 27 , AB = 28 ,那么现在求 ABC 和 ACA 等的值是多少
请帮我用 php 编写这个程序。
最佳答案
对输入字符串的每个字符使用 for
循环。然后使用 ord()
函数获取字符的 ASCII 代码 - 由于 A 是 65,而 A 应该是 1,因此将其调整为 64。在每个阶段将先前的值乘以 26 得到计算新的数字。
$input = "A";
$index = 0;
$input = strtoupper($input);
for( $i = 0, $end = strlen($input); $i < $end; $i++ ) {
$index = ($index*26)+(ord($input[$i])-64);
}
echo $index;
对于A
,它给出1
,对于AB
,它给出28
。
添加了该行
$input = strtoupper($input);
小写字母要适当调整。
关于php - 查找 ABC 和 ACA 的字母序列值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56035319/
假设如果 A = 1 , B = 2 ----- Z = 26 ,现在 AA = 27 , AB = 28 ,那么现在求 ABC 和 ACA 等的值是多少 请帮我用 php 编写这个程序。 最佳答案
假设如果 A = 1 , B = 2 ----- Z = 26 ,现在 AA = 27 , AB = 28 ,那么现在求 ABC 和 ACA 等的值是多少 请帮我用 php 编写这个程序。 最佳答案
我正在向 IRS 提交 RequestSubmissionStatusDetail 请求。 这是我的问题。向 IRS 提交以下文档时,我总是收到“无效的 WS 安全 header ”。我不知道我的请求
我在向 IRS ACA 网站提交 1094/1095C 时随机遇到错误。它一直是一个有效的代码,有一段时间我没有对代码进行任何更改,突然我开始在很少的提交中看到这个错误。 代码是java的。我们仍然能
我们正在尝试使用 A2A channel 向 IRS 政府网站提交 ACA 表格。我们能够使用 X509 和 SHA1 形成 XML 和所需的加密。 在向 IRS 站点发送 XML 时,我们收到错误消
我是 Hyperledger Aries 的新手,我无法弄清楚我做错了什么。 环境: Ubuntu16LTS Docker 18.09.7 构建 2d0083d hyperledger-aries-p
我们正在尝试通过公开的 Web 服务向 IRS 发送数据以进行 ACA 数据传输,但由于安全 header 中时间戳和签名元素的顺序,我们无法使 WSE 3.0 方法发挥作用。当 TimeStamp
我是一名优秀的程序员,十分优秀!